Fixed a whole lot of brokenness in Inbox SMS/Email notifications
WebGUI::Inbox::Message::create now passes isInbox flag to WebGUI::Mail::Send::create so that per-user notification settings get used SMS Gateway setting field is now 'text' instead of 'email' so that user can enter a properly formed value (such as 'myemailgateway.com', which is not an email address). Added SMS notification template as distinct from email notification template because SMSs should not be HTML and in general you will want to make your SMS notification message a lot shorter than your html email notification message (160 char limits in many countries). As a result, SMSs are now sent as separate emails to gateway rather than being CCd on email notification. Added smsGatewaySubject setting because many SMS Gateways use email subject for authentication. For consistency, also added Email notification email subject. Fixed handling of different combinations of site-wide sendInboxNotificationsOnly with per-user receiveInboxEmailNotifications and receiveInboxSmsEmailNotifications. * sendInboxNotificationsOnly && receiveInboxEmailNotifications = email notification * sendInboxNotificationsOnly && !receiveInboxEmailNotifications = no email * !sendInboxNotificationsOnly = ignore receiveInboxEmailNotifications * In all cases, SMS is optional and only dependent on receiveInboxSmsEmailNotifications Updated tests and i18n
This commit is contained in:
parent
3cc02af6bb
commit
388a0b1267
12 changed files with 264 additions and 109 deletions
|
|
@ -284,7 +284,7 @@ sub create {
|
|||
if (defined $user) {
|
||||
my $email;
|
||||
if ($isInbox) {
|
||||
$email = $user->getInboxAddresses;
|
||||
$email = $user->getInboxNotificationAddresses;
|
||||
}
|
||||
else {
|
||||
$email = $user->profileField("email");
|
||||
|
|
@ -511,7 +511,7 @@ sub send {
|
|||
next USER unless $user->status eq 'Active'; ##Don't send this to invalid user accounts
|
||||
my $emailAddress;
|
||||
if ($self->{_isInbox}) {
|
||||
$emailAddress = $user->getInboxAddresses;
|
||||
$emailAddress = $user->getInboxNotificationAddresses;
|
||||
}
|
||||
else {
|
||||
$emailAddress = $user->profileField('email');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue