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 2 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_ARRIVED'), $fromName, $sitename );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove space );

$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: 1 addition & 1 deletion administrator/language/en-GB/en-GB.com_messages.ini
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ 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_ARRIVED="A new private message has arrived from %s"
COM_MESSAGES_NEW_MESSAGE_ARRIVED="New Message from %1$s at %2$s"
COM_MESSAGES_NO_ITEM_SELECTED="No messages selected."
COM_MESSAGES_OPTION_READ="Read"
COM_MESSAGES_OPTION_UNREAD="Unread"
Expand Down