| @@ -30,32 +30,32 @@ | ||
| 30 | 30 | if (empty($forwardEmail)) { |
| 31 | 31 | $forwardEmail = acym_currentUserEmail(); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - $forwardEmail = str_replace('"', '', $forwardEmail); | |
| 34 | + $forwardAction = acym_escapeDB(json_encode(['0' => 'delete_message', '1' => 'forward_message', 'forward_to' => $forwardEmail])); | |
| 35 | 35 | |
| 36 | 36 | $query = "INSERT INTO `#__acym_rule` (`id`, `name`, `description`, `ordering`, `regex`, `executed_on`, `action_message`, `action_user`, `active`, `increment_stats`, `execute_action_after`) VALUES "; |
| 37 | 37 | $query .= "(1, 'ACYM_LIST_UNSUBSCRIBE_HANDLING', 'ACYM_LIST_UNSUBSCRIBE_HANDLING_DESC', 1, 'Please unsubscribe user ID \\\\d+', '[\"body\"]', '[\"delete_message\"]', '[\"unsubscribe_user\"]', 1, 0, 0),"; |
| 38 | 38 | $query .= "(2, 'ACYM_SUPPRESSION_LIST', 'ACYM_SUPPRESSION_LIST_DESC', 2, 'suppression list', '[\"body\"]', '[\"delete_message\"]', '[\"unsubscribe_user\",\"block_user\",\"empty_queue_user\"]', 1, 1, 0),"; |
| 39 | - $query .= "(3, 'ACYM_ACTION_REQUIRED', 'ACYM_ACTION_REQUIRED_DESC', 3, 'action *requ|verif', '[\"subject\"]', '{\"0\":\"delete_message\",\"1\":\"forward_message\",\"forward_to\":\"".$forwardEmail."\"}', '[]', 1, 0, 0),"; | |
| 39 | + $query .= "(3, 'ACYM_ACTION_REQUIRED', 'ACYM_ACTION_REQUIRED_DESC', 3, 'action *requ|verif', '[\"subject\"]', ".$forwardAction.", '[]', 1, 0, 0),"; | |
| 40 | 40 | $query .= "(4, 'ACYM_ACKNOWLEDGMENT_RECEIPT_SUBJECT', 'ACYM_ACKNOWLEDGMENT_RECEIPT_SUBJECT_DESC', 4, '(out|away) *(of|from)|vacation|vacanze|vacaciones|holiday|absen|congés|recept|acknowledg|thank you for|Auto *Response|Incident|Automati|Ticket|Resposta *automática', '[\"subject\"]', '[\"delete_message\"]', '[]', 1, 0, 0),"; |
| 41 | 41 | $query .= "(5, 'ACYM_FEEDBACK_LOOP', 'ACYM_FEEDBACK_LOOP_DESC', 5, 'feedback|[email protected]|complaints@.{0,15}email-abuse.amazonses.com|complaint about message', '[\"senderInfo\",\"subject\"]', '[\"save_message\",\"delete_message\"]', '[\"unsubscribe_user\",\"block_user\",\"empty_queue_user\"]', 1, 0, 0),"; |
| 42 | 42 | $query .= "(6, 'ACYM_FEEDBACK_LOOP_BODY', 'ACYM_FEEDBACK_LOOP_BODY_DESC', 6, 'Feedback-Type.{1,5}abuse', '[\"body\"]', '[\"save_message\",\"delete_message\"]', '[\"unsubscribe_user\"]', 1, 1, 0),"; |
| 43 | 43 | $query .= "(7, 'ACYM_MAILBOX_FULL', 'ACYM_MAILBOX_FULL_DESC', 7, '((mailbox|mailfolder|storage|quota|space|inbox) *(is)? *(over)? *(exceeded|size|storage|allocation|full|quota|maxi))|status(-code)? *(:|=)? *5.2.2|quota-issue|not *enough.{1,20}space|((over|exceeded|full|exhausted) *(allowed)? *(mail|storage|quota))|Space shortage', '[\"subject\",\"body\"]', '[\"save_message\",\"delete_message\"]', '[\"block_user\"]', 1, 1, 0),"; |
| 44 | - $query .= "(8, 'ACYM_BLOCKED_GOOGLE_GROUPS', 'ACYM_BLOCKED_GOOGLE_GROUPS_DESC', 8, 'message *rejected *by *Google *Groups', '[\"body\"]', '[\"delete_message\"]', '[]', 1, 1, 0),"; | |
| 45 | - $query .= "(9, 'ACYM_REJECTED', 'ACYM_REJECTED_DESC', 9, 'rejected *your *message|email *provider *rejected *it', '[\"body\"]', '[\"delete_message\"]', '[]', 1, 1, 0),"; | |
| 46 | - $query .= "(10, 'ACYM_MAILBOX_DOESNT_EXIST_1', 'ACYM_MAILBOX_DOESNT_EXIST_1_DESC', 10, '(Invalid|no such|unknown|bad|des?activated|inactive|unrouteable) *(mail|destination|recipient|user|address|person)|bad-mailbox|inactive-mailbox|not listed in.{1,20}directory|RecipNotFound|(user|mailbox|address|recipients?|host|account|domain) *(is|has been)? *(error|disabled|failed|unknown|unavailable|not *(found|available)|.{1,30}inactiv)|no *mailbox *here|user does.?n.t have.{0,30}account|no *longer *(active|working|in *use)|mail( *foi)? *desativado', '[\"subject\",\"body\"]', '[\"save_message\",\"delete_message\"]', '[\"block_user\"]', 1, 1, 0),"; | |
| 47 | - $query .= "(11, 'ACYM_MESSAGE_BLOCKED_RECIPIENTS', 'ACYM_MESSAGE_BLOCKED_RECIPIENTS_DESC', 11, 'blocked *by|block *list|look(ed)? *like *spam|spam-related|spam *detected| CXBL | CDRBL | IPBL | URLBL |(unacceptable|banned|offensive|filtered|blocked|unsolicited) *(content|message|e?-?mail)|service refused|(status(-code)?|554) *(:|=)? *5.7.1|administratively *denied|blacklisted *IP|policy *reasons|rejected.{1,10}spam|junkmail *rejected|throttling *constraints|exceeded.{1,10}max.{1,40}hour|comply with required standards|421 RP-00|550 SC-00|550 DY-00|550 OU-00', '[\"body\"]', '{\"0\":\"delete_message\",\"1\":\"forward_message\",\"forward_to\":\"".$forwardEmail."\"}', '[]', 1, 1, 0),"; | |
| 48 | - $query .= "(12, 'ACYM_MAILBOX_DOESNT_EXIST_2', 'ACYM_MAILBOX_DOESNT_EXIST_2_DESC', 12, 'status(-? ?code)? *(:|=)? *(550)? *5.(1.[1-6]|0.0|4.[0123467])|recipient *address *rejected|does *not *like *recipient|recipient *unknown *to *address|email *account *that *you *tried *to *reach *is *disabled', '[\"subject\",\"body\"]', '[\"save_message\",\"delete_message\"]', '[\"block_user\"]', 1, 1, 0),"; | |
| 44 | + $query .= "(8, 'ACYM_BLOCKED_GOOGLE_GROUPS', 'ACYM_BLOCKED_GOOGLE_GROUPS_DESC', 8, 'message *rejected *by *Google *Groups', '[\"body\"]', '[\"delete_message\"]', '[\"block_user\"]', 1, 1, 3),"; | |
| 45 | + $query .= "(9, 'ACYM_REJECTED', 'ACYM_REJECTED_DESC', 9, 'rejected *your *message|email *provider *rejected *it', '[\"body\"]', '[\"delete_message\"]', '[\"block_user\"]', 1, 1, 3),"; | |
| 46 | + $query .= "(10, 'ACYM_MAILBOX_DOESNT_EXIST_1', 'ACYM_MAILBOX_DOESNT_EXIST_1_DESC', 10, '(Invalid|no such|unknown|bad|des?activated|inactive|unrouteable) *(mail|destination|recipient|user|address|person)|bad-mailbox|inactive-mailbox|not listed in.{1,20}directory|RecipNotFound|(user|mailbox|address|recipients?|host|account|domain) *(is|has been)? *(error|disabled|failed|unknown|unavailable|not *(found|available)|.{1,30}inactiv)|no *mailbox *here|user does.?n.t have.{0,30}account|no *longer *(active|working|in *use)|mail( *foi)? *desativado|recipient \'[^\']+\' not known', '[\"subject\",\"body\"]', '[\"save_message\",\"delete_message\"]', '[\"block_user\"]', 1, 1, 0),"; | |
| 47 | + $query .= "(11, 'ACYM_MESSAGE_BLOCKED_RECIPIENTS', 'ACYM_MESSAGE_BLOCKED_RECIPIENTS_DESC', 11, 'blocked *by|block *list|look(ed)? *like *spam|spam-related|spam *detected| CXBL | CDRBL | IPBL | URLBL |(unacceptable|banned|offensive|filtered|blocked|unsolicited) *(content|message|e?-?mail)|service refused|(status(-code)?|554) *(:|=)? *5.7.1|administratively *denied|blacklisted *IP|policy *reasons|rejected.{1,10}spam|junkmail *rejected|throttling *constraints|exceeded.{1,10}max.{1,40}hour|comply with required standards|421 RP-00|550 SC-00|550 DY-00|550 OU-00|client *[0-9.]* *blocked *using', '[\"body\"]', ".$forwardAction.", '[\"block_user\"]', 1, 1, 3),"; | |
| 48 | + $query .= "(12, 'ACYM_MAILBOX_DOESNT_EXIST_2', 'ACYM_MAILBOX_DOESNT_EXIST_2_DESC', 12, 'status(-? ?code)? *(:|=)? *(550)? *5.(1.[1-6]|0.0|4.[0123467])|recipient *(address *)?rejected|does *not *like *recipient|recipient *unknown *to *address|email *account *that *you *tried *to *reach *is *disabled|no *mail-enabled *subscriptions', '[\"subject\",\"body\"]', '[\"save_message\",\"delete_message\"]', '[\"block_user\"]', 1, 1, 0),"; | |
| 49 | 49 | $query .= "(13, 'ACYM_DOMAIN_NOT_EXIST', 'ACYM_DOMAIN_NOT_EXIST_DESC', 13, 'No.{1,10}MX *(record|host)|host *does *not *receive *any *mail|bad-domain|connection.{1,10}mail.{1,20}fail|domain.{1,10}not *exist|fail.{1,10}establish *connection|Unable *to *lookup *DNS *for|Unable *to *connect *to *remote *host', '[\"subject\",\"body\"]', '[\"save_message\",\"delete_message\"]', '[\"block_user\"]', 1, 1, 0),"; |
| 50 | - $query .= "(14, 'ACYM_TEMPORARY_FAILURES', 'ACYM_TEMPORARY_FAILURES_DESC', 14, 'has.*been.*delayed|delayed *mail|message *delayed|message-expired|temporar(il)?y *(failure|unavailable|disable|offline|unable)|deferred|delayed *([0-9]*) *(hour|minut)|possible *mail *loop|too *many *hops|delivery *time *expired|Action.php: *delayed|status(-code)? *(:|=)? *4.4.6|will continue to be attempted|unable to deliver in.*Status: 4.4.7|Connection *closed *unexpectedly', '[\"subject\",\"body\"]', '[\"save_message\",\"delete_message\"]', '[\"block_user\"]', 1, 1, 0),"; | |
| 50 | + $query .= "(14, 'ACYM_TEMPORARY_FAILURES', 'ACYM_TEMPORARY_FAILURES_DESC', 14, 'has.*been.*delayed|delayed *mail|message *delayed|message-expired|temporar(il)?y *(failure|unavailable|disable|offline|unable)|deferred|delayed *([0-9]*) *(hour|minut)|possible *mail *loop|too *many *hops|delivery *time *expired|Action.php: *delayed|status(-code)? *(:|=)? *4.4.6|will continue to be attempted|unable to deliver in.*Status: 4.4.7|Connection *closed *unexpectedly', '[\"subject\",\"body\"]', '[\"save_message\",\"delete_message\"]', '[\"block_user\"]', 1, 1, 3),"; | |
| 51 | 51 | $query .= "(15, 'ACYM_FAILED_PERM', 'ACYM_FAILED_PERM_DESC', 15, 'failed *permanently|permanent.{1,20}(failure|error)|not *accepting *(any)? *mail|does *not *exist|no *valid *route|delivery *failure', '[\"subject\",\"body\"]', '[\"save_message\",\"delete_message\"]', '[\"block_user\"]', 1, 1, 0),"; |
| 52 | 52 | $query .= "(16, 'ACYM_ACKNOWLEDGMENT_RECEIPT_BODY', 'ACYM_ACKNOWLEDGMENT_RECEIPT_BODY_DESC', 16, 'vacanc|holiday|vacation|absen|urlaub|ferie|feriado|vacanz|vacaciones|(out *of|not *in|outside)( *the)? *office|automatisch *(generierte)? *Antwort|confirm *we(\\'ve| *have) *received|den *Ferien|automática|RISPOSTA AUTOMATICA|vakantie|recepcionado *(su *)?requerimiento|Kiitos viestistäsi|nicht im Büro|nicht am Arbeitsplatz|automatic *reply|auto(-|mated *|matic *)reply|Email *has *been *recived|ricevuto *il *Suo *messaggio|ticket|poza *biurem|Automatic *respon|Case *Number|Αυτόματη *απάντηση', '[\"body\"]', '[\"delete_message\"]', '[]', 1, 0, 0),"; |
| 53 | - $query .= "(17, 'ACYM_FINAL_RULE', 'ACYM_FINAL_RULE_DESC', 17, '.', '[\"senderInfo\",\"subject\"]', '{\"0\":\"delete_message\",\"1\":\"forward_message\",\"forward_to\":\"".$forwardEmail."\"}', '[]', 1, 0, 0);"; | |
| 53 | + $query .= "(17, 'ACYM_FINAL_RULE', 'ACYM_FINAL_RULE_DESC', 17, '.', '[\"senderInfo\",\"subject\"]', ".$forwardAction.", '[]', 1, 0, 0);"; | |
| 54 | 54 | |
| 55 | 55 | acym_query($query); |
| 56 | 56 | |
| 57 | - $this->config->save(['bounceVersion' => self::BOUNCE_VERSION]); | |
| 57 | + $this->config->saveConfig(['bounceVersion' => self::BOUNCE_VERSION]); | |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | public function installFields(): void |
| 61 | 61 | { |
| @@ -72,20 +72,19 @@ | ||
| 72 | 72 | { |
| 73 | 73 | $mailClass = new MailClass(); |
| 74 | 74 | $installedTemplates = 0; |
| 75 | 75 | |
| 76 | - $templates = acym_getFiles(ACYM_BACK.'templates'.DS, '.zip', false, true); | |
| 77 | - foreach ($templates as $oneTemplate) { | |
| 78 | - $templateName = substr($oneTemplate, strrpos($oneTemplate, DS) + 1); | |
| 79 | - $templateName = substr($templateName, 0, strrpos($templateName, '.')); | |
| 76 | + $templates = acym_getFolders(ACYM_BACK.'templates'.DS, '.', false, true); | |
| 77 | + foreach ($templates as $oneTemplateFolderPath) { | |
| 78 | + $templateName = substr($oneTemplateFolderPath, strrpos($oneTemplateFolderPath, DS) + 1); | |
| 79 | + $templateName = str_replace('_', ' ', $templateName); | |
| 80 | 80 | |
| 81 | 81 | $oneMail = $mailClass->getOneByName($templateName, false, MailClass::TYPE_TEMPLATE); |
| 82 | - if (!empty($oneMail)) continue; | |
| 82 | + if (!empty($oneMail)) { | |
| 83 | + continue; | |
| 84 | + } | |
| 83 | 85 | |
| 84 | - $templateFolder = $mailClass->extractTemplate($oneTemplate, false); | |
| 85 | - if (empty($templateFolder)) continue; | |
| 86 | - | |
| 87 | - if ($mailClass->installExtractedTemplate($templateFolder)) { | |
| 86 | + if ($mailClass->installExtractedTemplate($oneTemplateFolderPath, false)) { | |
| 88 | 87 | $installedTemplates++; |
| 89 | 88 | } |
| 90 | 89 | } |
| 91 | 90 | |
| @@ -117,11 +116,15 @@ | ||
| 117 | 116 | $mailClass = new MailClass(); |
| 118 | 117 | $notifications = $mailClass->getMailsByType(MailClass::TYPE_NOTIFICATION, $searchSettings); |
| 119 | 118 | $notifications = $notifications['mails']; |
| 120 | 119 | $user = $this->getCurrentUser(); |
| 120 | + if (empty($user)) { | |
| 121 | + return false; | |
| 122 | + } | |
| 121 | 123 | |
| 122 | 124 | $addNotif = []; |
| 123 | 125 | |
| 126 | + // Email sent with the cron report | |
| 124 | 127 | if (empty($notifications['acy_report'])) { |
| 125 | 128 | $addNotif[] = [ |
| 126 | 129 | 'name' => 'acy_report', |
| 127 | 130 | 'subject' => 'AcyMailing Cron Report {mainreport}', |
| @@ -128,8 +131,9 @@ | ||
| 128 | 131 | 'content' => '<p>{report}</p><p>{detailreport}</p>', |
| 129 | 132 | ]; |
| 130 | 133 | } |
| 131 | 134 | |
| 135 | + // Confirmation email for double opt-in | |
| 132 | 136 | if (empty($notifications['acy_confirm'])) { |
| 133 | 137 | $addNotif[] = [ |
| 134 | 138 | 'name' => 'acy_confirm', |
| 135 | 139 | 'subject' => '{subscriber:name|ucfirst}, {trans:ACYM_PLEASE_CONFIRM_SUBSCRIPTION}', |
| @@ -235,8 +239,19 @@ | ||
| 235 | 239 | 'drag_editor' => 0, |
| 236 | 240 | ]; |
| 237 | 241 | } |
| 238 | 242 | |
| 243 | + if (empty($notifications['acy_notification_auto_campaign_admin'])) { | |
| 244 | + $addNotif[] = [ | |
| 245 | + 'name' => 'acy_notification_auto_campaign_admin', | |
| 246 | + 'subject' => acym_translation('ACYM_NOTIFICATION_AUTO_CAMPAIGN_SUBJECT'), | |
| 247 | + 'content' => $this->getFormatedNotification( | |
| 248 | + '<h1 style="font-size: 24px;">'.acym_translation('ACYM_HELLO').' '.$this->getDTextDisplay('{subscriber:name|ucfirst}', 'Marc').',</h1> | |
| 249 | + <p>'.acym_translation('ACYM_NOTIFICATION_AUTO_CAMPAIGN_BODY').'</p>' | |
| 250 | + ), | |
| 251 | + ]; | |
| 252 | + } | |
| 253 | + | |
| 239 | 254 | $firstEmail = $mailClass->getOneByName(acym_translation(self::FIRST_EMAIL_NAME_KEY)); |
| 240 | 255 | if (empty($firstEmail)) { |
| 241 | 256 | $body = '<div id="acym__wysid__template" class="cell"><table class="body"><tbody><tr><td align="center" class="center acym__wysid__template__content" valign="top" style="background-color: rgb(239, 239, 239); padding: 30px 0px 120px;"><center><table align="center" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="acym__wysid__row ui-droppable ui-sortable" bgcolor="#ffffff" style="background-color: rgb(255, 255, 255); min-height: 0px; display: table-cell;"><table class="row acym__wysid__row__element" border="0" cellpadding="0" cellspacing="0" style="z-index: 100; background-color: rgb(238, 238, 238);" bgcolor="#eeeeee"><tbody bgcolor="" style="background-color: inherit;"><tr><th class="small-12 medium-12 large-12 columns" style="height: auto;"><table class="acym__wysid__column" style="min-height: 0px; display: table; height: auto;" border="0" cellpadding="0" cellspacing="0"><tbody class="ui-sortable" style="min-height: 0px; display: table-row-group; height: auto;"><tr class="acym__wysid__column__element ui-draggable" style="position: relative; top: inherit; left: inherit; right: inherit; bottom: inherit; height: auto;"><td class="large-12 acym__wysid__column__element__td" style="outline-width: 0px;"><div class="acym__wysid__tinymce--text mce-content-body" style="position: relative;" spellcheck="false" contenteditable="false" id="mce_41"><p style="font-family: Helvetica; font-size: 12px; font-weight: normal; font-style: normal; color: #000000; word-break: break-word; text-align: center; line-height: inherit;"><span style="font-size: 12px;">Having trouble seeing this email? <span class="mceNonEditable acym_dynamic" contenteditable="false" data-dynamic="{readonline}View it online{/readonline}"><a style="text-decoration: none; font-family: Helvetica; font-size: 12px; font-weight: normal; line-height: inherit; font-style: normal; color: #38c2f3;" href="view_it_online_link" target="_blank" rel="noopener"><span class="acym_online">View it online</span></a><em class="acym_remove_dynamic acymicon-close"></em></span> </span></p></div></td></tr></tbody></table></th></tr></tbody></table><table class="row acym__wysid__row__element" bgcolor="#ffffff" style="background-color: rgb(255, 255, 255); z-index: 100;" cellpadding="0" cellspacing="0" border="0"><tbody bgcolor="" style="background-color: inherit;"><tr><th class="small-12 medium-12 large-12 columns acym__wysid__row__element__th" valign="top"><table class="acym__wysid__column" border="0" cellpadding="0" cellspacing="0" style="min-height: 0px; display: table;"><tbody class="ui-sortable" style="min-height: 0px; display: table-row-group;"><tr class="acym__wysid__column__element ui-draggable" style="position: relative; top: inherit; left: inherit; right: inherit; bottom: inherit; height: auto;"><td class="large-12 acym__wysid__column__element__td" style="height: 21px; outline-width: 0px;"><span class="acy-editor__space" style="display:block; padding: 0;margin: 0; height: 100%"></span></td></tr><tr class="acym__wysid__column__element ui-draggable" style="position: relative; top: inherit; left: inherit; right: inherit; bottom: inherit; height: auto;"><td class="large-12 acym__wysid__column__element__td" style="outline-width: 0px;"><div class="acym__wysid__tinymce--image mce-content-body" style="position: relative;" spellcheck="false" contenteditable="false" id="mce_45"><p style="font-family: Helvetica; font-size: 12px; font-weight: normal; font-style: normal; color: #000000; word-break: break-word; line-height: inherit;"><img class="acym__wysid__media__inserted" style="max-width: 100%; height: 85px; box-sizing: border-box; padding: 0px 5px; display: block; margin-left: auto; margin-right: auto; width: 306px;" src="'.ACYM_LIVE.ACYM_UPLOAD_FOLDER.'logo_acymailing_step_email.png" alt="logo_acymailing_step_email.png" height="85" width="306"></p></div></td></tr><tr class="acym__wysid__column__element ui-draggable" style="position: relative; top: inherit; left: inherit; right: inherit; bottom: inherit; height: auto;"><td class="large-12 acym__wysid__column__element__td" style="height: 29px; outline-width: 0px;"><span class="acy-editor__space" style="display:block; padding: 0;margin: 0; height: 100%"></span></td></tr><tr class="acym__wysid__column__element acym__wysid__column__element__separator cursor-pointer ui-draggable" style="position: relative; top: inherit; left: inherit; right: inherit; bottom: inherit; height: auto;"><td class="large-12 acym__wysid__column__element__td" style="outline-width: 0px;"><hr style="border-bottom: 3px solid rgb(214, 214, 214); width: 24%; border-top: none; border-left: none; border-right: none; size: 3px;" class="acym__wysid__row__separator"></td></tr></tbody></table></th></tr></tbody></table><table class="row acym__wysid__row__element" bgcolor="#ffffff" style="background-color: rgb(255, 255, 255); z-index: 100;" cellpadding="0" cellspacing="0" border="0"><tbody bgcolor="" style="background-color: inherit;"><tr><th class="small-12 medium-12 large-12 columns acym__wysid__row__element__th" valign="top"><table class="acym__wysid__column" border="0" cellpadding="0" cellspacing="0" style="min-height: 0px; display: table;"><tbody class="ui-sortable" style="min-height: 0px; display: table-row-group;"><tr class="acym__wysid__column__element ui-draggable" style="position: relative; top: inherit; left: inherit; right: inherit; bottom: inherit; height: auto;"><td class="large-12 acym__wysid__column__element__td" style="outline-width: 0px;"><div class="acym__wysid__tinymce--text mce-content-body" style="position: relative;" spellcheck="false" contenteditable="false" id="mce_42"><h1 style="font-family: Helvetica; font-size: 20px; font-weight: normal; font-style: normal; color: #000000; line-height: inherit; text-align: left;">Dear <span class="mceNonEditable acym_dynamic" contenteditable="false" data-dynamic="{subscriber:name|part:first|ucfirst}">Admin<em class="acym_remove_dynamic acymicon-close"></em></span>,</h1></div></td></tr><tr class="acym__wysid__column__element ui-draggable" style="position: relative; top: inherit; left: inherit; right: inherit; bottom: inherit; height: auto;"><td class="large-12 acym__wysid__column__element__td" style="outline-width: 0px;"><div class="acym__wysid__tinymce--text mce-content-body" style="position: relative;" spellcheck="false" contenteditable="false" id="mce_43"><p style="word-break: break-word; font-family: Helvetica; font-size: 12px; font-weight: normal; font-style: normal; color: #000000; line-height: inherit; text-align: left;"><span style="color: #000000;"><span style="font-family: Helvetica;">Feel free to drag & drop some content and </span><span style="font-family: Helvetica;">try the AcyMailing editor.</span></span></p><p style="word-break: break-word; font-family: Helvetica; font-size: 12px; font-weight: normal; font-style: normal; color: #000000; line-height: inherit; text-align: left;"><span style="color: #000000; font-family: Helvetica;">Once it is done, click on the "Apply" button.</span></p></div></td></tr></tbody></table></th></tr></tbody></table><table class="row acym__wysid__row__element" bgcolor="#ffffff" style="background-color: rgb(255, 255, 255); z-index: 100; padding: 0px;" cellpadding="0" cellspacing="0" border="0"><tbody bgcolor="" style="background-color: inherit;"><tr><th class="small-12 medium-12 large-12 columns acym__wysid__row__element__th" valign="top"><table class="acym__wysid__column" border="0" cellpadding="0" cellspacing="0" style="min-height: 0px; display: table;"><tbody class="ui-sortable" style="min-height: 0px; display: table-row-group;"><tr class="acym__wysid__column__element ui-draggable" style="position: relative; top: inherit; left: inherit; right: inherit; bottom: inherit; height: auto;"><td class="large-12 acym__wysid__column__element__td" style="outline-width: 0px;"><div class="acym__wysid__tinymce--image mce-content-body" style="position: relative;" spellcheck="false" contenteditable="false" id="mce_46"><p style="font-family: Helvetica; font-size: 12px; font-weight: normal; font-style: normal; color: #000000; word-break: break-word; line-height: inherit;"><img class="acym__wysid__media__inserted" style="max-width: 100%; height: auto; box-sizing: border-box; padding: 0px 5px; display: block; margin-left: auto; margin-right: auto; width: 580px;" src="'.ACYM_LIVE.ACYM_UPLOAD_FOLDER.'image_mailing_step_email.jpg" alt="image_mailing_step_email.jpg" height="400.68" width="580"></p></div></td></tr></tbody></table></th></tr></tbody></table><table class="row acym__wysid__row__element" bgcolor="#303e47" style="background-color: rgb(48, 62, 71); z-index: 100;" cellpadding="0" cellspacing="0" border="0"><tbody bgcolor="" style="background-color: inherit;"><tr><th class="small-12 medium-12 large-12 columns acym__wysid__row__element__th" valign="top"><table class="acym__wysid__column" border="0" cellpadding="0" cellspacing="0" style="min-height: 0px; display: table;"><tbody class="ui-sortable" style="min-height: 0px; display: table-row-group;"><tr class="acym__wysid__column__element ui-draggable" style="position: relative; top: inherit; left: inherit; right: inherit; bottom: inherit; height: auto;"><td class="large-12 acym__wysid__column__element__td" style="outline-width: 0px;"><div class="acym__wysid__tinymce--text mce-content-body" style="position: relative;" spellcheck="false" contenteditable="false" id="mce_44"><p style="font-family: Helvetica; font-size: 12px; font-weight: normal; font-style: normal; color: #000000; text-align: center; word-break: break-word; line-height: inherit;"><span style="color: #ffffff;">If you\'re not interested anymore, you can</span> <span class="mceNonEditable acym_dynamic" data-dynamic="{unsubscribe}unsubscribe{/unsubscribe}" contenteditable="false"><a style="text-decoration: none; font-family: Helvetica; font-size: 12px; font-weight: normal; line-height: inherit; font-style: normal; color: #38c2f3;" target="_blank" href="'.acym_frontendLink( |
| 242 | 257 | 'frontusers&task=unsubscribe&id='.$user->id.'&key='.$user->key.'&'.acym_noTemplate() |
| @@ -286,9 +301,9 @@ | ||
| 286 | 301 | $notif->type = $oneNotif['type'] ?? MailClass::TYPE_NOTIFICATION; |
| 287 | 302 | $notif->settings = $oneNotif['settings'] ?? ''; |
| 288 | 303 | $notif->drag_editor = $oneNotif['drag_editor'] ?? 1; |
| 289 | 304 | $notif->creator_id = acym_currentUserId(); |
| 290 | - $notif->creation_date = date('Y-m-d H:i:s', time() - date('Z')); | |
| 305 | + $notif->creation_date = gmdate('Y-m-d H:i:s', time()); | |
| 291 | 306 | $notif->name = $oneNotif['name']; |
| 292 | 307 | $notif->subject = $oneNotif['subject']; |
| 293 | 308 | $notif->body = $oneNotif['content']; |
| 294 | 309 | $notif->thumbnail = $oneNotif['thumbnail'] ?? ''; |
| @@ -342,9 +357,9 @@ | ||
| 342 | 357 | } |
| 343 | 358 | |
| 344 | 359 | $mail = new \stdClass(); |
| 345 | 360 | $mail->name = $oneOverride['name']; |
| 346 | - $mail->creation_date = date('Y-m-d H:i:s', time() - date('Z')); | |
| 361 | + $mail->creation_date = gmdate('Y-m-d H:i:s', time()); | |
| 347 | 362 | $mail->type = MailClass::TYPE_OVERRIDE; |
| 348 | 363 | $mail->subject = $oneOverride['new_subject']; |
| 349 | 364 | $mail->body = $this->getFormatedNotification($oneOverride['new_body']); |
| 350 | 365 | $mail->drag_editor = 1; |
| @@ -432,9 +447,9 @@ | ||
| 432 | 447 | $mailAutomation = new \stdClass(); |
| 433 | 448 | $mailAutomation->type = MailClass::TYPE_AUTOMATION; |
| 434 | 449 | $mailAutomation->drag_editor = 1; |
| 435 | 450 | $mailAutomation->creator_id = acym_currentUserId(); |
| 436 | - $mailAutomation->creation_date = date('Y-m-d H:i:s', time() - date('Z')); | |
| 451 | + $mailAutomation->creation_date = gmdate('Y-m-d H:i:s', time()); | |
| 437 | 452 | $mailAutomation->name = acym_translation($info[$title]->emailTitle); |
| 438 | 453 | $mailAutomation->subject = acym_translation($info[$title]->emailSubject); |
| 439 | 454 | $mailAutomation->body = $this->getFormatedNotification($info[$title]->emailContent); |
| 440 | 455 | |
| @@ -447,14 +462,14 @@ | ||
| 447 | 462 | $newAction->condition_id = $newCondition->id; |
| 448 | 463 | $newAction->actions = '[{"acy_add_queue":{"mail_id":"'.intval($mailAutomation->id).'","time":"[time]"}}]'; |
| 449 | 464 | $newAction->filters = '{"0":{"1":{"acy_field":{"field":"email","operator":"=","value":"'.acym_currentUserEmail().'"}}},"type_filter":"classic"}'; |
| 450 | 465 | $newAction->order = 1; |
| 451 | - $newAction->id = $actionClass->save($newAction); | |
| 466 | + $actionClass->save($newAction); | |
| 452 | 467 | } |
| 453 | 468 | |
| 454 | 469 | private function getDTextDisplay(string $dtext, string $preview): string |
| 455 | 470 | { |
| 456 | - $display = '<span class="acym_dynamic mceNonEditable" contenteditable="false" data-dynamic="'.acym_escape($dtext).'" data-mce-selected="1">'; | |
| 471 | + $display = '<span class="acym_dynamic mceNonEditable" contenteditable="false" data-dynamic="'.esc_attr($dtext).'" data-mce-selected="1">'; | |
| 457 | 472 | $display .= $preview; |
| 458 | 473 | $display .= '<em class="acym_remove_dynamic acymicon-close">‍</em>'; |
| 459 | 474 | $display .= '</span>'; |
| 460 | 475 | |
| @@ -468,9 +483,9 @@ | ||
| 468 | 483 | |
| 469 | 484 | return $beginning.$content.$ending; |
| 470 | 485 | } |
| 471 | 486 | |
| 472 | - private function getCurrentUser() | |
| 487 | + private function getCurrentUser(): ?object | |
| 473 | 488 | { |
| 474 | 489 | $currentCMSId = acym_currentUserId(); |
| 475 | 490 | $userClass = new UserClass(); |
| 476 | 491 | $user = $userClass->getOneByCMSId($currentCMSId); |
| @@ -488,8 +503,12 @@ | ||
| 488 | 503 | $newUser->email = $currentCMSEmail; |
| 489 | 504 | $newUser->confirmed = 1; |
| 490 | 505 | $newUser->cms_id = $currentCMSId; |
| 491 | 506 | $newUser->id = $userClass->save($newUser); |
| 507 | + | |
| 508 | + if (empty($newUser->id)) { | |
| 509 | + return null; | |
| 510 | + } | |
| 492 | 511 | |
| 493 | 512 | return $userClass->getOneById($newUser->id); |
| 494 | 513 | } |
| 495 | 514 | } |