Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

unsubscribe_user_from_periodic_report()

Description

Unsubscribes a user from a specified periodic report.

This function inserts a record into the unsubscribe table, preventing the specified user
from receiving future emails related to the given periodic report.

Parameters

ColumnTypeDefaultDescription
$user_id int The ID of the user to unsubscribe.
$periodic_email_id int The ID of the periodic email report to unsubscribe from.

Return

bool Returns true upon successful unsubscription.

Location

include/reporting_functions.php lines 645 to 653

Definition

 
function unsubscribe_user_from_periodic_report($user_id$periodic_email_id)
    {
    
$query 'INSERT INTO report_periodic_emails_unsubscribe 
                  (user_id, periodic_email_id)
                 VALUES (?, ?)'
;
    
ps_query($query, array("i",$user_id"i",$periodic_email_id));

    return 
true;
    }

This article was last updated 13th December 2024 20:35 Europe/London time based on the source file dated 7th November 2024 17:40 Europe/London time.