Password Reset: Add email message to Email Templates.

This commit is contained in:
Nate
2019-03-13 23:30:39 -06:00
parent db6f070a19
commit 4bc43fb60e
6 changed files with 112 additions and 27 deletions
-20
View File
@@ -761,26 +761,6 @@ $text['label-reset_password']['ru-ru'] = "Сброс пароля";
$text['label-reset_password']['sv-se'] = "Återställ Lösenord";
$text['label-reset_password']['uk-ua'] = "Скинути пароль";
$text['label-reset_link']['en-us'] = "Password Reset Link";
$text['label-reset_link']['ar-eg'] = " رابط اعادة تعيين كلمة السر";
$text['label-reset_link']['de-at'] = "Link zum Zurücksetzen des Passworts"; //copied from de-de
$text['label-reset_link']['de-ch'] = "Link zum Zurücksetzen des Passworts"; //copied from de-de
$text['label-reset_link']['de-de'] = "Link zum Zurücksetzen des Passworts";
$text['label-reset_link']['es-cl'] = "Password Reset Enlace";
$text['label-reset_link']['es-mx'] = "Password Reset Enlace"; //copied from es-cl
$text['label-reset_link']['fr-ca'] = "Lien de réinitialisation du mot de passe"; //copied from fr-fr
$text['label-reset_link']['fr-fr'] = "Lien de réinitialisation du mot de passe";
$text['label-reset_link']['he-il'] = "קישור לאיפוס סיסמה";
$text['label-reset_link']['it-it'] = "Link per il Reset della Password";
$text['label-reset_link']['nl-nl'] = "";
$text['label-reset_link']['pl-pl'] = "Link do resetowania hasla";
$text['label-reset_link']['pt-br'] = "Link para redefinir senha";
$text['label-reset_link']['pt-pt'] = "Password Reset Link";
$text['label-reset_link']['ro-ro'] = "Link resetare parolă";
$text['label-reset_link']['ru-ru'] = "Ссылка для сброса пароля";
$text['label-reset_link']['sv-se'] = "Länk för Återställning av Lösenord";
$text['label-reset_link']['uk-ua'] = "Посилання на скидання пароля";
$text['label-repeat_password']['en-us'] = "Repeat Password";
$text['label-repeat_password']['ar-eg'] = "تاكيد كلمة السر";
$text['label-repeat_password']['de-at'] = "Passwort wiederholen"; //copied from de-de
+46
View File
@@ -84,6 +84,52 @@ if ($domains_processed == 1) {
unset ($prep_statement);
}
//insert default password reset email template
if (file_exists($_SERVER['DOCUMENT_ROOT'].'/app/email_templates')) {
//build the array
$x = 0;
$array['email_templates'][$x]['email_template_uuid'] = '05b529c4-fba7-4071-bab3-143b076392e7';
$array['email_templates'][$x]['template_language'] = 'en-us';
$array['email_templates'][$x]['template_category'] = 'password_reset';
$array['email_templates'][$x]['template_subcategory'] = 'default';
$array['email_templates'][$x]['template_subject'] = 'Password Reset';
$array['email_templates'][$x]['template_body'] .= "<html>\n";
$array['email_templates'][$x]['template_body'] .= "<body>\n";
$array['email_templates'][$x]['template_body'] .= "<center><a href='https://\${domain}'><img src='\${logo_full}' style='width: 200px; height: auto; border: none;'></a></center><br />\n";
$array['email_templates'][$x]['template_body'] .= "A password reset was just requested for the FusionPBX user account associated with this email address.<br /><br />\n";
$array['email_templates'][$x]['template_body'] .= "<b>If you submitted this request</b>, click the button below to begin the password reset process for your user account.<br /><br />";
$array['email_templates'][$x]['template_body'] .= "\${reset_button}<br /><br />\n";
$array['email_templates'][$x]['template_body'] .= "If you did not initiate this action, however, please ignore this message and your password will remain unchanged.\n";
$array['email_templates'][$x]['template_body'] .= "If you have questions or concerns regarding this email, please contact your system administrator.";
$array['email_templates'][$x]['template_body'] .= "<br /><br /><br />\n";
$array['email_templates'][$x]['template_body'] .= "<a href='https://\${domain}'><img src='\${logo_shield}' width='31' height='30' border='0' align='left' style='margin-top: 3px; margin-right: 5px;'></a>\n";
$array['email_templates'][$x]['template_body'] .= "<i><b>FusionPBX</b></i><br />\n";
$array['email_templates'][$x]['template_body'] .= "<a href='https://\${domain}'>\${domain}</a>\n";
$array['email_templates'][$x]['template_body'] .= "<br /><br /><br />\n";
$array['email_templates'][$x]['template_body'] .= "</body>\n";
$array['email_templates'][$x]['template_body'] .= "</html>\n";
$array['email_templates'][$x]['template_type'] = 'html';
$array['email_templates'][$x]['template_enabled'] = 'true';
$array['email_templates'][$x]['template_description'] = 'Default password reset email template.';
$x++;
//add the temporary permission
$p = new permissions;
$p->add("email_template_add", 'temp');
$p->add("email_template_edit", 'temp');
//save to the data
$database = new database;
$database->app_name = 'email_templates';
$database->app_uuid = '8173e738-2523-46d5-8943-13883befd2fd';
$database->save($array);
unset($array);
//remove the temporary permission
$p->delete("email_template_add", 'temp');
$p->delete("email_template_edit", 'temp');
}
}
?>