Skip to content

Commit

Permalink
Support HTML format when sending email auth-codes (#245)
Browse files Browse the repository at this point in the history
Support HTML format when sending email auth-codes  (#244)

* add html message

* common service var

* fix
  • Loading branch information
Findeton committed Aug 31, 2022
1 parent 265ce88 commit b6297c3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions SequentConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ var SequentConfigData = {
// Allowed values: true|false
allowEditElectionJson: true,

// For admins:
// Allow sending custom html in the email messages sent from the admin console.
// Allowed values: true|false
allowHtmlEmails: false,

// For admins:
// Allow editing the election.presentation.theme_css so that any election
// Admin can highly customize the election directly with CSS.
Expand Down
4 changes: 4 additions & 0 deletions avRegistration/auth-method-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,10 @@ angular.module('avRegistration')
data.msg = election.census.config.msg;
if ('email' === auth_method) {
data.subject = election.census.config.subject;
if (ConfigService.allowHtmlEmails &&
election.census.config.html_message) {
data.html_message = election.census.config.html_message;
}
}
}
if (angular.isDefined(user_ids)) {
Expand Down
5 changes: 5 additions & 0 deletions dist/SequentConfig-v6.1.5.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ var SequentConfigData = {
// Allowed values: true|false
allowEditElectionJson: true,

// For admins:
// Allow sending custom html in the email messages sent from the admin console.
// Allowed values: true|false
allowHtmlEmails: false,

// For admins:
// Allow editing the election.presentation.theme_css so that any election
// Admin can highly customize the election directly with CSS.
Expand Down
3 changes: 2 additions & 1 deletion dist/appCommon-v6.1.5.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ angular.module("avRegistration").config(function() {}), angular.module("avRegist
},
sendAuthCodes: function(data, election, user_ids, auth_method, extra) {
var url = backendUrl + "auth-event/" + data + "/census/send_auth/", data = {};
return angular.isDefined(election) && (data.msg = election.census.config.msg, "email" === auth_method && (data.subject = election.census.config.subject)),
return angular.isDefined(election) && (data.msg = election.census.config.msg, "email" === auth_method && (data.subject = election.census.config.subject,
ConfigService.allowHtmlEmails && election.census.config.html_message && (data.html_message = election.census.config.html_message))),
angular.isDefined(user_ids) && (data["user-ids"] = user_ids), angular.isDefined(auth_method) && (data["auth-method"] = auth_method),
extra && (data.extra = extra), $http.post(url, data);
},
Expand Down

0 comments on commit b6297c3

Please sign in to comment.