Add a method to return emails for Inbox notifications.
Method is driven by profile data and settings.
This commit is contained in:
parent
987269f3c3
commit
bc3b204d9b
2 changed files with 72 additions and 3 deletions
|
|
@ -503,6 +503,34 @@ sub getGroupIdsRecursive {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getInboxAddresses ( )
|
||||
|
||||
Return a string with addresses that the user wants to receive Inbox
|
||||
notifications. If the user does not want Inbox notifications, then
|
||||
the string will be empty.
|
||||
|
||||
=cut
|
||||
|
||||
sub getInboxAddresses {
|
||||
my $self = shift;
|
||||
my $emails = '';
|
||||
if ( $self->profileField('receiveInboxEmailNotifications')
|
||||
&& $self->profileField('email')) {
|
||||
$emails = $self->profileField('email');
|
||||
}
|
||||
if ( $self->profileField('receiveInboxSmsNotifications')
|
||||
&& $self->profileField('cellPhone')
|
||||
&& $self->session->setting->get('smsGateway')) {
|
||||
$emails .= ',' if $emails;
|
||||
my $phoneNumber = $self->profileField('cellPhone');
|
||||
$phoneNumber =~ tr/0-9//dc; ##remove nonnumbers
|
||||
$emails = join '', $emails, $phoneNumber, '@', $self->session->setting->get('smsGateway');
|
||||
}
|
||||
return $emails;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getProfileFieldPrivacySetting ( [field ])
|
||||
|
||||
Returns the privacy setting for the field passed in. If no field is passed in the entire hash is returned
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue