Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

You've Got Mail #20162

Merged
merged 4 commits into from
Apr 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions administrator/components/com_messages/models/message.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,13 @@ public function save($data)

// Build the email subject and message
$sitename = JFactory::getApplication()->get('sitename');
$fromName = $fromUser->get('name');
$siteURL = JUri::root() . 'administrator/index.php?option=com_messages&view=message&message_id=' . $table->message_id;
$subject = sprintf($lang->_('COM_MESSAGES_NEW_MESSAGE_ARRIVED'), $sitename);
$msg = sprintf($lang->_('COM_MESSAGES_PLEASE_LOGIN'), $siteURL);
$subject = html_entity_decode($table->subject, ENT_COMPAT, 'UTF-8');
$message = strip_tags(html_entity_decode($table->message, ENT_COMPAT, 'UTF-8'));

$subj = sprintf($lang->_('COM_MESSAGES_NEW_MESSAGE'), $fromName, $sitename);
$msg = $subject . "\n\n" . $message . "\n\n" . sprintf($lang->_('COM_MESSAGES_PLEASE_LOGIN'), $siteURL);

// Send the email
$mailer = JFactory::getMailer();
Expand Down Expand Up @@ -396,7 +400,7 @@ public function save($data)
return true;
}

$mailer->setSubject($subject);
$mailer->setSubject($subj);
$mailer->setBody($msg);

// The Send method will raise an error via JError on a failure, we do not need to check it ourselves here
Expand Down
2 changes: 2 additions & 0 deletions administrator/language/en-GB/en-GB.com_messages.ini
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ COM_MESSAGES_N_ITEMS_TRASHED="%d messages trashed."
COM_MESSAGES_N_ITEMS_TRASHED_1="Message trashed."
COM_MESSAGES_N_ITEMS_UNPUBLISHED="%d messages marked as unread."
COM_MESSAGES_N_ITEMS_UNPUBLISHED_1="Message marked as unread."
COM_MESSAGES_NEW_MESSAGE="New Message from %1$s at %2$s"
; The following string is deprecated and will be removed in Joomla 4.0
COM_MESSAGES_NEW_MESSAGE_ARRIVED="A new private message has arrived from %s"
COM_MESSAGES_NO_ITEM_SELECTED="No messages selected."
COM_MESSAGES_OPTION_READ="Read"
Expand Down
2 changes: 2 additions & 0 deletions language/en-GB/en-GB.com_messages.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
; Note : All ini files need to be saved as UTF-8

COM_MESSAGES_ERR_SEND_FAILED="The user has locked their mailbox. Message failed."
COM_MESSAGES_NEW_MESSAGE="New Message from %1$s at %2$s"
; The following string is deprecated and will be removed in Joomla 4.0
COM_MESSAGES_NEW_MESSAGE_ARRIVED="A new private message has arrived from %s"
COM_MESSAGES_PLEASE_LOGIN="Please log in to %s to read your message."