Function Hook_task_send_newsletter->run
Definitions
sources/hooks/systems/tasks/send_newsletter.php
- Run the task hook.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: array
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $message_id | integer | No | No | required parameter | N/A | N/A | The newsletter message in the newsletter archive |
| $message_raw | LONG_TEXT | No | No | required parameter | N/A | N/A | The newsletter message |
| $subject | SHORT_TEXT | No | No | required parameter | N/A | N/A | The newsletter subject |
| $lang | LANGUAGE_NAME | No | No | required parameter | N/A | N/A | The language |
| $send_details | array | No | No | required parameter | N/A | N/A | A map describing what newsletters the newsletter is being sent to |
| $html_only | BINARY | No | No | required parameter | N/A | N/A | Whether to only send in HTML format |
| $from_email | No | No | required parameter | N/A | N/A | Override the e-mail address the mail is sent from (blank: staff address) | |
| $from_name | string | No | No | required parameter | N/A | N/A | Override the name the mail is sent from (blank: site name) |
| $priority | integer | No | No | required parameter | N/A | 1 5 | The message priority (1=urgent, 3=normal, 5=low) |
| $spreadsheet_data | array | No | No | required parameter | N/A | N/A | Spreadsheet data of extra subscribers (blank: none). This is in the same newsletter spreadsheet format that we export elsewhere. |
| $mail_template | ID_TEXT | No | No | required parameter | N/A | N/A | The template used to show the e-mail |
Returns
- A tuple of at least 2: Return mime-type, content (either Tempcode, or a string, or a filename and file-path pair to a temporary file), map of HTTP headers if transferring immediately, map of ini_set commands if transferring immediately (null: show standard success message)
- Type: ?array
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Run the task hook.
*
* @param integer $message_id The newsletter message in the newsletter archive
* @param LONG_TEXT $message_raw The newsletter message
* @param SHORT_TEXT $subject The newsletter subject
* @param LANGUAGE_NAME $lang The language
* @param array $send_details A map describing what newsletters the newsletter is being sent to
* @param BINARY $html_only Whether to only send in HTML format
* @param EMAIL $from_email Override the e-mail address the mail is sent from (blank: staff address)
* @param string $from_name Override the name the mail is sent from (blank: site name)
* @param integer $priority The message priority (1=urgent, 3=normal, 5=low)
* @range 1 5
* @param array $spreadsheet_data Spreadsheet data of extra subscribers (blank: none). This is in the same newsletter spreadsheet format that we export elsewhere.
* @param ID_TEXT $mail_template The template used to show the e-mail
* @return ?array A tuple of at least 2: Return mime-type, content (either Tempcode, or a string, or a filename and file-path pair to a temporary file), map of HTTP headers if transferring immediately, map of ini_set commands if transferring immediately (null: show standard success message)
*/
public function run(int $message_id, string $message_raw, string $subject, string $lang, array $send_details, int $html_only, string $from_email, string $from_name, int $priority, array $spreadsheet_data, string $mail_template) : ?array
* Run the task hook.
*
* @param integer $message_id The newsletter message in the newsletter archive
* @param LONG_TEXT $message_raw The newsletter message
* @param SHORT_TEXT $subject The newsletter subject
* @param LANGUAGE_NAME $lang The language
* @param array $send_details A map describing what newsletters the newsletter is being sent to
* @param BINARY $html_only Whether to only send in HTML format
* @param EMAIL $from_email Override the e-mail address the mail is sent from (blank: staff address)
* @param string $from_name Override the name the mail is sent from (blank: site name)
* @param integer $priority The message priority (1=urgent, 3=normal, 5=low)
* @range 1 5
* @param array $spreadsheet_data Spreadsheet data of extra subscribers (blank: none). This is in the same newsletter spreadsheet format that we export elsewhere.
* @param ID_TEXT $mail_template The template used to show the e-mail
* @return ?array A tuple of at least 2: Return mime-type, content (either Tempcode, or a string, or a filename and file-path pair to a temporary file), map of HTTP headers if transferring immediately, map of ini_set commands if transferring immediately (null: show standard success message)
*/
public function run(int $message_id, string $message_raw, string $subject, string $lang, array $send_details, int $html_only, string $from_email, string $from_name, int $priority, array $spreadsheet_data, string $mail_template) : ?array
