View | Details | Raw Unified | Return to bug 8085 | Differences between
and this patch

Collapse All | Expand All

(-)a/classes/controllers/grid/citation/PKPCitationGridHandler.inc.php (-4 lines)
 Lines 486-495   class PKPCitationGridHandler extends GridHandler { Link Here 
486
		import('lib.pkp.classes.mail.Mail');
486
		import('lib.pkp.classes.mail.Mail');
487
		$mail = new Mail();
487
		$mail = new Mail();
488
488
489
		// Sender
490
		$user =& $request->getUser();
491
		$mail->setFrom($user->getEmail(), $user->getFullName());
492
493
		// Recipient
489
		// Recipient
494
		$assocObject =& $this->getAssocObject();
490
		$assocObject =& $this->getAssocObject();
495
		$author =& $assocObject->getUser();
491
		$author =& $assocObject->getUser();
(-)a/lib/pkp/classes/mail/Mail.inc.php (+36 lines)
 Lines 324-329   class Mail extends DataObject { Link Here 
324
	}
324
	}
325
325
326
	/**
326
	/**
327
	 * Set the reply-to of the message.
328
	 * @param $email string or null to clear
329
	 * @param $name string optional
330
	 */
331
	function setReplyTo($email, $name = '') {
332
		if ($email === null) $this->setData('replyTo', null);
333
		return $this->setData('replyTo', array('name' => $name, 'email' => $email));
334
	}
335
336
	/**
337
	 * Get the reply-to of the message.
338
	 * @return array
339
	 */
340
	function getReplyTo() {
341
		return $this->getData('replyTo');
342
	}
343
344
	/**
345
	 * Return a string containing the reply-to address.
346
	 * @return string
347
	 */
348
	function getReplyToString($send = false) {
349
		$replyTo = $this->getReplyTo();
350
		if ($replyTo == null) {
351
			return null;
352
		} else {
353
			return (Mail::encodeDisplayName($replyTo['name'], $send) . ' <'.$replyTo['email'].'>');
354
		}
355
	}
356
357
	/**
327
	 * Set the subject of the message.
358
	 * Set the subject of the message.
328
	 * @param $subject string
359
	 * @param $subject string
329
	 */
360
	 */
 Lines 468-473   class Mail extends DataObject { Link Here 
468
			$this->addHeader('From', $from);
499
			$this->addHeader('From', $from);
469
		}
500
		}
470
501
502
		if (($r = $this->getReplyToString()) != '') {
503
			$this->addHeader('Reply-To', $r);
504
		}
505
471
		$ccs = $this->getAddressArrayString($this->getCcs(), true, true);
506
		$ccs = $this->getAddressArrayString($this->getCcs(), true, true);
472
		if ($ccs != null) {
507
		if ($ccs != null) {
473
			$this->addHeader('Cc', $ccs);
508
			$this->addHeader('Cc', $ccs);
 Lines 552-557   class Mail extends DataObject { Link Here 
552
	/**
587
	/**
553
	 * Encode a display name for proper inclusion with an email address.
588
	 * Encode a display name for proper inclusion with an email address.
554
	 * @param $displayName string
589
	 * @param $displayName string
590
	 * @param $send boolean True to encode the results for sending
555
	 * @return string
591
	 * @return string
556
	 */
592
	 */
557
	function encodeDisplayName($displayName, $send = false) {
593
	function encodeDisplayName($displayName, $send = false) {
(-)a/lib/pkp/classes/notification/PKPNotificationManager.inc.php (-3 / +3 lines)
 Lines 445-451   class PKPNotificationManager { Link Here 
445
		import('classes.mail.MailTemplate');
445
		import('classes.mail.MailTemplate');
446
		$site =& $request->getSite();
446
		$site =& $request->getSite();
447
		$mail = new MailTemplate('NOTIFICATION', null, null, null, true, true);
447
		$mail = new MailTemplate('NOTIFICATION', null, null, null, true, true);
448
		$mail->setFrom($site->getLocalizedContactEmail(), $site->getLocalizedContactName());
448
		$mail->setReplyTo($site->getLocalizedContactEmail(), $site->getLocalizedContactName());
449
		$mail->assignParams(array(
449
		$mail->assignParams(array(
450
			'notificationContents' => $this->getNotificationContents($request, $notification),
450
			'notificationContents' => $this->getNotificationContents($request, $notification),
451
			'url' => $this->getNotificationUrl($request, $notification),
451
			'url' => $this->getNotificationUrl($request, $notification),
 Lines 473-479   class PKPNotificationManager { Link Here 
473
			$dispatcher =& $router->getDispatcher();
473
			$dispatcher =& $router->getDispatcher();
474
474
475
			$mail = new MailTemplate('NOTIFICATION_MAILLIST');
475
			$mail = new MailTemplate('NOTIFICATION_MAILLIST');
476
			$mail->setFrom($site->getLocalizedContactEmail(), $site->getLocalizedContactName());
476
			$mail->setReplyTo($site->getLocalizedContactEmail(), $site->getLocalizedContactName());
477
			$mail->assignParams(array(
477
			$mail->assignParams(array(
478
				'notificationContents' => $this->getNotificationContents($request, $notification),
478
				'notificationContents' => $this->getNotificationContents($request, $notification),
479
				'url' => $this->getNotificationUrl($request, $notification),
479
				'url' => $this->getNotificationUrl($request, $notification),
 Lines 512-518   class PKPNotificationManager { Link Here 
512
		}
512
		}
513
513
514
		$mail = new MailTemplate($template);
514
		$mail = new MailTemplate($template);
515
		$mail->setFrom($site->getLocalizedContactEmail(), $site->getLocalizedContactName());
515
		$mail->setReplyTo($site->getLocalizedContactEmail(), $site->getLocalizedContactName());
516
		$mail->assignParams($params);
516
		$mail->assignParams($params);
517
		$mail->addRecipient($email);
517
		$mail->addRecipient($email);
518
		$mail->send();
518
		$mail->send();
(-)a/lib/pkp/templates/email/email.tpl (-4 lines)
 Lines 145-154   function deleteAttachment(fileId) { Link Here 
145
	<td colspan="2">&nbsp;</td>
145
	<td colspan="2">&nbsp;</td>
146
</tr>
146
</tr>
147
<tr valign="top">
147
<tr valign="top">
148
	<td class="label">{translate key="email.from"}</td>
149
	<td class="value">{$from|escape}</td>
150
</tr>
151
<tr valign="top">
152
	<td width="20%" class="label">{fieldLabel name="subject" key="email.subject"}</td>
148
	<td width="20%" class="label">{fieldLabel name="subject" key="email.subject"}</td>
153
	<td width="80%" class="value"><input type="text" id="subject" name="subject" value="{$subject|escape}" size="60" maxlength="120" class="textField" /></td>
149
	<td width="80%" class="value"><input type="text" id="subject" name="subject" value="{$subject|escape}" size="60" maxlength="120" class="textField" /></td>
154
</tr>
150
</tr>
(-)a/classes/author/form/submit/AuthorSubmitStep5Form.inc.php (-1 / +1 lines)
 Lines 176-182   class AuthorSubmitStep5Form extends AuthorSubmitForm { Link Here 
176
		// Send author notification email
176
		// Send author notification email
177
		import('classes.mail.ArticleMailTemplate');
177
		import('classes.mail.ArticleMailTemplate');
178
		$mail = new ArticleMailTemplate($article, 'SUBMISSION_ACK', null, null, null, false);
178
		$mail = new ArticleMailTemplate($article, 'SUBMISSION_ACK', null, null, null, false);
179
		$mail->setFrom($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
179
		$mail->setReplyTo(null);
180
		if ($mail->isEnabled()) {
180
		if ($mail->isEnabled()) {
181
			$mail->addRecipient($user->getEmail(), $user->getFullName());
181
			$mail->addRecipient($user->getEmail(), $user->getFullName());
182
			// If necessary, BCC the acknowledgement to someone.
182
			// If necessary, BCC the acknowledgement to someone.
(-)a/classes/mail/MailTemplate.inc.php (-11 / +20 lines)
 Lines 86-93   class MailTemplate extends PKPMailTemplate { Link Here 
86
		// Default "From" to user if available, otherwise site/journal principal contact
86
		// Default "From" to user if available, otherwise site/journal principal contact
87
		$user =& Request::getUser();
87
		$user =& Request::getUser();
88
		if ($user) {
88
		if ($user) {
89
			$this->setFrom($user->getEmail(), $user->getFullName());
89
			$this->setReplyTo($user->getEmail(), $user->getFullName());
90
		} elseif (is_null($journal) || is_null($journal->getSetting('contactEmail'))) {
90
		}
91
		if (is_null($journal) || is_null($journal->getSetting('contactEmail'))) {
91
			$site =& Request::getSite();
92
			$site =& Request::getSite();
92
			$this->setFrom($site->getLocalizedContactEmail(), $site->getLocalizedContactName());
93
			$this->setFrom($site->getLocalizedContactEmail(), $site->getLocalizedContactName());
93
94
 Lines 143-158   class MailTemplate extends PKPMailTemplate { Link Here 
143
	 */
144
	 */
144
	function send($clearAttachments = true) {
145
	function send($clearAttachments = true) {
145
		if (isset($this->journal)) {
146
		if (isset($this->journal)) {
146
			//If {$templateSignature} exists in the body of the
147
			//If {$templateSignature} and/or {$templateHeader}
147
			// message, replace it with the journal signature;
148
			// exist in the body of the message, replace them with
148
			// otherwise just append it. This is here to
149
			// the journal signature; otherwise just pre/append
149
			// accomodate MIME-encoded messages or other cases
150
			// them. This is here to accomodate MIME-encoded
150
			// where the signature cannot just be appended.
151
			// messages or other cases where the signature cannot
151
			$searchString = '{$templateSignature}';
152
			// just be appended.
152
			if (strstr($this->getBody(), $searchString) === false) {
153
			$header = $this->journal->getSetting('emailHeader');
153
				$this->setBody($this->getBody() . "\n" . $this->journal->getSetting('emailSignature'));
154
			if (strstr($this->getBody(), '{$templateHeader}') === false) {
155
				$this->setBody($header . "\n" . $this->getBody());
156
			} else {
157
				$this->setBody(str_replace('{$templateHeader}', $header, $this->getBody()));
158
			}
159
160
			$signature = $this->journal->getSetting('emailSignature');
161
			if (strstr($this->getBody(), '{$templateSignature}') === false) {
162
				$this->setBody($this->getBody() . "\n" . $signature);
154
			} else {
163
			} else {
155
				$this->setBody(str_replace($searchString, $this->journal->getSetting('emailSignature'), $this->getBody()));
164
				$this->setBody(str_replace('{$templateSignature}', $signature, $this->getBody()));
156
			}
165
			}
157
166
158
			$envelopeSender = $this->journal->getSetting('envelopeSender');
167
			$envelopeSender = $this->journal->getSetting('envelopeSender');
(-)a/classes/manager/form/UserManagementForm.inc.php (-1 / +1 lines)
 Lines 353-359   class UserManagementForm extends Form { Link Here 
353
				// Send welcome email to user
353
				// Send welcome email to user
354
				import('classes.mail.MailTemplate');
354
				import('classes.mail.MailTemplate');
355
				$mail = new MailTemplate('USER_REGISTER');
355
				$mail = new MailTemplate('USER_REGISTER');
356
				$mail->setFrom($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
356
				$mail->setReplyTo(null);
357
				$mail->assignParams(array('username' => $this->getData('username'), 'password' => $password, 'userFullName' => $user->getFullName()));
357
				$mail->assignParams(array('username' => $this->getData('username'), 'password' => $password, 'userFullName' => $user->getFullName()));
358
				$mail->addRecipient($user->getEmail(), $user->getFullName());
358
				$mail->addRecipient($user->getEmail(), $user->getFullName());
359
				$mail->send();
359
				$mail->send();
(-)a/classes/manager/form/setup/JournalSetupStep1Form.inc.php (+1 lines)
 Lines 49-54   class JournalSetupStep1Form extends JournalSetupForm { Link Here 
49
				'contributors' => 'object',
49
				'contributors' => 'object',
50
				'history' => 'string',
50
				'history' => 'string',
51
				'envelopeSender' => 'string',
51
				'envelopeSender' => 'string',
52
				'emailHeader' => 'string',
52
				'emailSignature' => 'string',
53
				'emailSignature' => 'string',
53
				'searchDescription' => 'string',
54
				'searchDescription' => 'string',
54
				'searchKeywords' => 'string',
55
				'searchKeywords' => 'string',
(-)a/classes/payment/ojs/OJSPaymentManager.inc.php (-2 / +2 lines)
 Lines 426-432   class OJSPaymentManager extends PaymentManager { Link Here 
426
426
427
				import('classes.mail.MailTemplate');
427
				import('classes.mail.MailTemplate');
428
				$mail = new MailTemplate('GIFT_AVAILABLE', $giftLocale);
428
				$mail = new MailTemplate('GIFT_AVAILABLE', $giftLocale);
429
				$mail->setFrom($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
429
				$mail->setReplyTo(null);
430
				$mail->assignParams(array(
430
				$mail->assignParams(array(
431
					'giftJournalName' => $giftJournalName,
431
					'giftJournalName' => $giftJournalName,
432
					'giftNoteTitle' => $giftNoteTitle,
432
					'giftNoteTitle' => $giftNoteTitle,
 Lines 459-465   class OJSPaymentManager extends PaymentManager { Link Here 
459
					$mail = new MailTemplate('GIFT_USER_LOGIN', $giftLocale);
459
					$mail = new MailTemplate('GIFT_USER_LOGIN', $giftLocale);
460
				}
460
				}
461
461
462
				$mail->setFrom($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
462
				$mail->setReplyTo(null);
463
				$mail->assignParams($params);
463
				$mail->assignParams($params);
464
				$mail->addRecipient($recipientEmail, $user->getFullName());
464
				$mail->addRecipient($recipientEmail, $user->getFullName());
465
				$mail->send();
465
				$mail->send();
(-)a/classes/sectionEditor/form/CreateReviewerForm.inc.php (-1 / +1 lines)
 Lines 193-199   class CreateReviewerForm extends Form { Link Here 
193
			// Send welcome email to user
193
			// Send welcome email to user
194
			import('classes.mail.MailTemplate');
194
			import('classes.mail.MailTemplate');
195
			$mail = new MailTemplate('REVIEWER_REGISTER');
195
			$mail = new MailTemplate('REVIEWER_REGISTER');
196
			$mail->setFrom($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
196
			$mail->setReplyTo(null);
197
			$mail->assignParams(array('username' => $this->getData('username'), 'password' => $password, 'userFullName' => $user->getFullName()));
197
			$mail->assignParams(array('username' => $this->getData('username'), 'password' => $password, 'userFullName' => $user->getFullName()));
198
			$mail->addRecipient($user->getEmail(), $user->getFullName());
198
			$mail->addRecipient($user->getEmail(), $user->getFullName());
199
			$mail->send();
199
			$mail->send();
(-)a/classes/submission/form/comment/CommentForm.inc.php (-1 / +1 lines)
 Lines 129-135   class CommentForm extends Form { Link Here 
129
129
130
		import('classes.mail.ArticleMailTemplate');
130
		import('classes.mail.ArticleMailTemplate');
131
		$email = new ArticleMailTemplate($article, 'SUBMISSION_COMMENT');
131
		$email = new ArticleMailTemplate($article, 'SUBMISSION_COMMENT');
132
		$email->setFrom($this->user->getEmail(), $this->user->getFullName());
132
		$email->setReplyTo($this->user->getEmail(), $this->user->getFullName());
133
133
134
		$commentText = $this->getData('comments');
134
		$commentText = $this->getData('comments');
135
135
(-)a/classes/submission/form/comment/EditCommentForm.inc.php (-1 / +1 lines)
 Lines 292-298   class EditCommentForm extends Form { Link Here 
292
		import('classes.mail.ArticleMailTemplate');
292
		import('classes.mail.ArticleMailTemplate');
293
		$email = new ArticleMailTemplate($this->article, 'SUBMISSION_COMMENT');
293
		$email = new ArticleMailTemplate($this->article, 'SUBMISSION_COMMENT');
294
		$journal =& $request->getJournal();
294
		$journal =& $request->getJournal();
295
		if ($journal) $email->setFrom($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
295
		$email->setReplyTo(null);
296
296
297
		foreach ($recipients as $emailAddress => $name) {
297
		foreach ($recipients as $emailAddress => $name) {
298
			$email->addRecipient($emailAddress, $name);
298
			$email->addRecipient($emailAddress, $name);
(-)a/classes/submission/reviewer/ReviewerAction.inc.php (-2 / +2 lines)
 Lines 51-57   class ReviewerAction extends Action { Link Here 
51
			$email = new ArticleMailTemplate($reviewerSubmission, $decline?'REVIEW_DECLINE':'REVIEW_CONFIRM');
51
			$email = new ArticleMailTemplate($reviewerSubmission, $decline?'REVIEW_DECLINE':'REVIEW_CONFIRM');
52
			// Must explicitly set sender because we may be here on an access
52
			// Must explicitly set sender because we may be here on an access
53
			// key, in which case the user is not technically logged in
53
			// key, in which case the user is not technically logged in
54
			$email->setFrom($reviewer->getEmail(), $reviewer->getFullName());
54
			$email->setReplyTo($reviewer->getEmail(), $reviewer->getFullName());
55
			if (!$email->isEnabled() || ($send && !$email->hasErrors())) {
55
			if (!$email->isEnabled() || ($send && !$email->hasErrors())) {
56
				HookRegistry::call('ReviewerAction::confirmReview', array(&$reviewerSubmission, &$email, $decline));
56
				HookRegistry::call('ReviewerAction::confirmReview', array(&$reviewerSubmission, &$email, $decline));
57
				if ($email->isEnabled()) {
57
				if ($email->isEnabled()) {
 Lines 131-137   class ReviewerAction extends Action { Link Here 
131
			$email = new ArticleMailTemplate($reviewerSubmission, 'REVIEW_COMPLETE');
131
			$email = new ArticleMailTemplate($reviewerSubmission, 'REVIEW_COMPLETE');
132
			// Must explicitly set sender because we may be here on an access
132
			// Must explicitly set sender because we may be here on an access
133
			// key, in which case the user is not technically logged in
133
			// key, in which case the user is not technically logged in
134
			$email->setFrom($reviewer->getEmail(), $reviewer->getFullName());
134
			$email->setReplyTo($reviewer->getEmail(), $reviewer->getFullName());
135
135
136
			if (!$email->isEnabled() || ($send && !$email->hasErrors())) {
136
			if (!$email->isEnabled() || ($send && !$email->hasErrors())) {
137
				HookRegistry::call('ReviewerAction::recordRecommendation', array(&$reviewerSubmission, &$email, $recommendation));
137
				HookRegistry::call('ReviewerAction::recordRecommendation', array(&$reviewerSubmission, &$email, $recommendation));
(-)a/classes/subscription/SubscriptionAction.inc.php (-1 / +1 lines)
 Lines 647-653   class SubscriptionAction { Link Here 
647
647
648
		import('classes.mail.MailTemplate');
648
		import('classes.mail.MailTemplate');
649
		$mail = new MailTemplate($mailTemplateKey);
649
		$mail = new MailTemplate($mailTemplateKey);
650
		$mail->setFrom($subscriptionContactEmail, $subscriptionContactName);
650
		$mail->setReplyTo($subscriptionContactEmail, $subscriptionContactName);
651
		$mail->addRecipient($subscriptionContactEmail, $subscriptionContactName);
651
		$mail->addRecipient($subscriptionContactEmail, $subscriptionContactName);
652
		$mail->setSubject($mail->getSubject($journal->getPrimaryLocale()));
652
		$mail->setSubject($mail->getSubject($journal->getPrimaryLocale()));
653
		$mail->setBody($mail->getBody($journal->getPrimaryLocale()));
653
		$mail->setBody($mail->getBody($journal->getPrimaryLocale()));
(-)a/classes/subscription/form/SubscriptionForm.inc.php (-1 / +1 lines)
 Lines 297-303   class SubscriptionForm extends Form { Link Here 
297
297
298
		import('classes.mail.MailTemplate');
298
		import('classes.mail.MailTemplate');
299
		$mail = new MailTemplate($mailTemplateKey);
299
		$mail = new MailTemplate($mailTemplateKey);
300
		$mail->setFrom($subscriptionEmail, $subscriptionName);
300
		$mail->setReplyTo($subscriptionEmail, $subscriptionName);
301
		$mail->addRecipient($user->getEmail(), $user->getFullName());
301
		$mail->addRecipient($user->getEmail(), $user->getFullName());
302
		$mail->setSubject($mail->getSubject($journal->getPrimaryLocale()));
302
		$mail->setSubject($mail->getSubject($journal->getPrimaryLocale()));
303
		$mail->setBody($mail->getBody($journal->getPrimaryLocale()));
303
		$mail->setBody($mail->getBody($journal->getPrimaryLocale()));
(-)a/classes/tasks/OpenAccessNotification.inc.php (-1 / +1 lines)
 Lines 34-40   class OpenAccessNotification extends ScheduledTask { Link Here 
34
			$email = new MailTemplate('OPEN_ACCESS_NOTIFY', $journal->getPrimaryLocale());
34
			$email = new MailTemplate('OPEN_ACCESS_NOTIFY', $journal->getPrimaryLocale());
35
35
36
			$email->setSubject($email->getSubject($journal->getPrimaryLocale()));
36
			$email->setSubject($email->getSubject($journal->getPrimaryLocale()));
37
			$email->setFrom($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
37
			$email->setReplyTo(null);
38
			$email->addRecipient($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
38
			$email->addRecipient($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
39
39
40
			$paramArray = array(
40
			$paramArray = array(
(-)a/classes/tasks/ReviewReminder.inc.php (-1 / +1 lines)
 Lines 37-43   class ReviewReminder extends ScheduledTask { Link Here 
37
37
38
		$email = new ArticleMailTemplate($article, $reviewerAccessKeysEnabled?'REVIEW_REMIND_AUTO_ONECLICK':'REVIEW_REMIND_AUTO', $journal->getPrimaryLocale(), false, $journal);
38
		$email = new ArticleMailTemplate($article, $reviewerAccessKeysEnabled?'REVIEW_REMIND_AUTO_ONECLICK':'REVIEW_REMIND_AUTO', $journal->getPrimaryLocale(), false, $journal);
39
		$email->setJournal($journal);
39
		$email->setJournal($journal);
40
		$email->setFrom($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
40
		$email->setReplyTo(null);
41
		$email->addRecipient($reviewer->getEmail(), $reviewer->getFullName());
41
		$email->addRecipient($reviewer->getEmail(), $reviewer->getFullName());
42
		$email->setSubject($email->getSubject($journal->getPrimaryLocale()));
42
		$email->setSubject($email->getSubject($journal->getPrimaryLocale()));
43
		$email->setBody($email->getBody($journal->getPrimaryLocale()));
43
		$email->setBody($email->getBody($journal->getPrimaryLocale()));
(-)a/classes/tasks/SubscriptionExpiryReminder.inc.php (-1 / +1 lines)
 Lines 68-74   class SubscriptionExpiryReminder extends ScheduledTask { Link Here 
68
68
69
		import('classes.mail.MailTemplate');
69
		import('classes.mail.MailTemplate');
70
		$mail = new MailTemplate($emailKey, $journal->getPrimaryLocale());
70
		$mail = new MailTemplate($emailKey, $journal->getPrimaryLocale());
71
		$mail->setFrom($subscriptionEmail, $subscriptionName);
71
		$mail->setReplyTo($subscriptionEmail, $subscriptionName);
72
		$mail->addRecipient($user->getEmail(), $user->getFullName());
72
		$mail->addRecipient($user->getEmail(), $user->getFullName());
73
		$mail->setSubject($mail->getSubject($journal->getPrimaryLocale()));
73
		$mail->setSubject($mail->getSubject($journal->getPrimaryLocale()));
74
		$mail->setBody($mail->getBody($journal->getPrimaryLocale()));
74
		$mail->setBody($mail->getBody($journal->getPrimaryLocale()));
(-)a/classes/user/form/RegistrationForm.inc.php (-2 / +2 lines)
 Lines 332-338   class RegistrationForm extends Form { Link Here 
332
332
333
				// Send email validation request to user
333
				// Send email validation request to user
334
				$mail = new MailTemplate('USER_VALIDATE');
334
				$mail = new MailTemplate('USER_VALIDATE');
335
				$mail->setFrom($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
335
				$mail->setReplyTo(null);
336
				$mail->assignParams(array(
336
				$mail->assignParams(array(
337
					'userFullName' => $user->getFullName(),
337
					'userFullName' => $user->getFullName(),
338
					'activateUrl' => Request::url($journal->getPath(), 'user', 'activateUser', array($this->getData('username'), $accessKey))
338
					'activateUrl' => Request::url($journal->getPath(), 'user', 'activateUser', array($this->getData('username'), $accessKey))
 Lines 344-350   class RegistrationForm extends Form { Link Here 
344
			if ($this->getData('sendPassword')) {
344
			if ($this->getData('sendPassword')) {
345
				// Send welcome email to user
345
				// Send welcome email to user
346
				$mail = new MailTemplate('USER_REGISTER');
346
				$mail = new MailTemplate('USER_REGISTER');
347
				$mail->setFrom($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
347
				$mail->setReplyTo(null);
348
				$mail->assignParams(array(
348
				$mail->assignParams(array(
349
					'username' => $this->getData('username'),
349
					'username' => $this->getData('username'),
350
					'password' => String::substr($this->getData('password'), 0, 30), // Prevent mailer abuse via long passwords
350
					'password' => String::substr($this->getData('password'), 0, 30), // Prevent mailer abuse via long passwords
(-)a/lib/pkp (-1 / +1 lines)
Line 1    Link Here 
1
Subproject commit ac56c9fcefb3aeff16918b03c41d196a9f19cee4
1
Subproject commit 89cb7d7c66bd5f8e54204b092fdc36c4f7b417aa-dirty
(-)a/locale/en_US/default.xml (+2 lines)
 Lines 129-134   Please follow the following protocol for making electronic revisions to your man Link Here 
129
	<pre>4. FORMATTING
129
	<pre>4. FORMATTING
130
	The paragraph that begins "This last topic..." is not indented.</pre>]]></message>
130
	The paragraph that begins "This last topic..." is not indented.</pre>]]></message>
131
	
131
	
132
	<message key="default.journalSettings.emailHeader">The following message is being delivered on behalf of {$journalName}.
133
________________________________________________________________________</message>
132
	<message key="default.journalSettings.emailSignature">________________________________________________________________________
134
	<message key="default.journalSettings.emailSignature">________________________________________________________________________
133
{$journalName}
135
{$journalName}
134
{$indexUrl}/{$journalPath}</message>
136
{$indexUrl}/{$journalPath}</message>
(-)a/locale/en_US/manager.xml (+2 lines)
 Lines 258-263    Link Here 
258
	<message key="manager.setup.emailBounceAddressDescription">Any undeliverable emails will result in an error message to this address.</message>
258
	<message key="manager.setup.emailBounceAddressDescription">Any undeliverable emails will result in an error message to this address.</message>
259
	<message key="manager.setup.emailBounceAddressDisabled"><![CDATA[<strong>Note:</strong> To activate this option, the site administrator must enable the <tt>allow_envelope_sender</tt> option in the OJS configuration file. Additional server configuration may be required to support this functionality (which may not be possible on all servers), as indicated in the OJS documentation.]]></message>
259
	<message key="manager.setup.emailBounceAddressDisabled"><![CDATA[<strong>Note:</strong> To activate this option, the site administrator must enable the <tt>allow_envelope_sender</tt> option in the OJS configuration file. Additional server configuration may be required to support this functionality (which may not be possible on all servers), as indicated in the OJS documentation.]]></message>
260
	<message key="manager.setup.emails">Email Identification</message>
260
	<message key="manager.setup.emails">Email Identification</message>
261
	<message key="manager.setup.emailHeader">Email Header</message>
262
	<message key="manager.setup.emailHeaderDescription">The prepared emails that are sent by the system on behalf of the journal will begin with the following header. These emails will be addressed from the Principal Contact, so it's important to clarify that the Primary Contact is not necessarily responsible for the message content, which may be sent on behalf of a different user.</message>
261
	<message key="manager.setup.emailSignature">Signature</message>
263
	<message key="manager.setup.emailSignature">Signature</message>
262
	<message key="manager.setup.emailSignatureDescription">The prepared emails that are sent by the system on behalf of the journal will have the following signature added to the end. The body of the prepared emails are available for editing under Journal Management.</message>
264
	<message key="manager.setup.emailSignatureDescription">The prepared emails that are sent by the system on behalf of the journal will have the following signature added to the end. The body of the prepared emails are available for editing under Journal Management.</message>
263
	<message key="manager.setup.enableAnnouncements">Enable Journal Managers to add journal announcements.</message>
265
	<message key="manager.setup.enableAnnouncements">Enable Journal Managers to add journal announcements.</message>
(-)a/pages/login/LoginHandler.inc.php (-2 / +2 lines)
 Lines 107-115   class LoginHandler extends PKPLoginHandler { Link Here 
107
		
107
		
108
		// Set the sender based on the current context
108
		// Set the sender based on the current context
109
		if ($journal && $journal->getSetting('supportEmail')) {
109
		if ($journal && $journal->getSetting('supportEmail')) {
110
			$mail->setFrom($journal->getSetting('supportEmail'), $journal->getSetting('supportName'));
110
			$mail->setReplyTo($journal->getSetting('supportEmail'), $journal->getSetting('supportName'));
111
		} else { 
111
		} else { 
112
			$mail->setFrom($site->getLocalizedContactEmail(), $site->getLocalizedContactName());
112
			$mail->setReplyTo($site->getLocalizedContactEmail(), $site->getLocalizedContactName());
113
		}
113
		}
114
	}
114
	}
115
115
(-)a/plugins/generic/booksForReview/classes/BooksForReviewReminder.inc.php (-1 / +1 lines)
 Lines 40-46   class BooksForReviewReminder extends ScheduledTask { Link Here 
40
		import('classes.mail.MailTemplate');
40
		import('classes.mail.MailTemplate');
41
		$mail = new MailTemplate($emailKey);
41
		$mail = new MailTemplate($emailKey);
42
42
43
		$mail->setFrom($book->getEditorEmail(), $book->getEditorFullName());
43
		$mail->setReplyTo($book->getEditorEmail(), $book->getEditorFullName());
44
		$mail->addRecipient($book->getUserEmail(), $book->getUserFullName());
44
		$mail->addRecipient($book->getUserEmail(), $book->getUserFullName());
45
		$mail->setSubject($mail->getSubject($journal->getPrimaryLocale()));
45
		$mail->setSubject($mail->getSubject($journal->getPrimaryLocale()));
46
		$mail->setBody($mail->getBody($journal->getPrimaryLocale()));
46
		$mail->setBody($mail->getBody($journal->getPrimaryLocale()));
(-)a/plugins/generic/booksForReview/pages/BooksForReviewAuthorHandler.inc.php (-4 lines)
 Lines 124-132   class BooksForReviewAuthorHandler extends Handler { Link Here 
124
						$user =& $request->getUser();
124
						$user =& $request->getUser();
125
						$userId = $user->getId();
125
						$userId = $user->getId();
126
126
127
						$userFullName = $user->getFullName();
128
						$userEmail = $user->getEmail();
129
130
						$editorFullName = $book->getEditorFullName();
127
						$editorFullName = $book->getEditorFullName();
131
						$editorEmail = $book->getEditorEmail();
128
						$editorEmail = $book->getEditorEmail();
132
129
 Lines 137-143   class BooksForReviewAuthorHandler extends Handler { Link Here 
137
						);
134
						);
138
135
139
						$email->addRecipient($editorEmail, $editorFullName);
136
						$email->addRecipient($editorEmail, $editorFullName);
140
						$email->setFrom($userEmail, $userFullName);
141
						$email->assignParams($paramArray);
137
						$email->assignParams($paramArray);
142
					}
138
					}
143
					$returnUrl = $request->url(null, 'author', 'requestBookForReview', $bookId);
139
					$returnUrl = $request->url(null, 'author', 'requestBookForReview', $bookId);
(-)a/plugins/generic/booksForReview/pages/BooksForReviewEditorHandler.inc.php (-4 / +4 lines)
 Lines 665-671   class BooksForReviewEditorHandler extends Handler { Link Here 
665
						);
665
						);
666
666
667
						$email->addRecipient($userEmail, $userName);
667
						$email->addRecipient($userEmail, $userName);
668
						$email->setFrom($book->getEditorEmail(), $book->getEditorFullName());
668
						$email->setReplyTo($book->getEditorEmail(), $book->getEditorFullName());
669
						$email->assignParams($paramArray);
669
						$email->assignParams($paramArray);
670
					}
670
					}
671
					$returnUrl = $request->url(null, 'editor', 'assignBookForReviewAuthor', $bookId, array('returnPage' => $returnPage, 'userId' => $userId));
671
					$returnUrl = $request->url(null, 'editor', 'assignBookForReviewAuthor', $bookId, array('returnPage' => $returnPage, 'userId' => $userId));
 Lines 741-747   class BooksForReviewEditorHandler extends Handler { Link Here 
741
					);
741
					);
742
742
743
					$email->addRecipient($userEmail, $userFullName);
743
					$email->addRecipient($userEmail, $userFullName);
744
					$email->setFrom($book->getEditorEmail(), $book->getEditorFullName());
744
					$email->setReplyTo($book->getEditorEmail(), $book->getEditorFullName());
745
					$email->assignParams($paramArray);
745
					$email->assignParams($paramArray);
746
				}
746
				}
747
				$returnUrl = $request->url(null, 'editor', 'denyBookForReviewAuthor', $bookId, array('returnPage' => $returnPage));
747
				$returnUrl = $request->url(null, 'editor', 'denyBookForReviewAuthor', $bookId, array('returnPage' => $returnPage));
 Lines 828-834   class BooksForReviewEditorHandler extends Handler { Link Here 
828
					);
828
					);
829
829
830
					$email->addRecipient($userEmail, $userFullName);
830
					$email->addRecipient($userEmail, $userFullName);
831
					$email->setFrom($book->getEditorEmail(), $book->getEditorFullName());
831
					$email->setReplyTo($book->getEditorEmail(), $book->getEditorFullName());
832
					$email->assignParams($paramArray);
832
					$email->assignParams($paramArray);
833
				}
833
				}
834
				$returnUrl = $request->url(null, 'editor', 'notifyBookForReviewMailed', $bookId, array('returnPage' => $returnPage));
834
				$returnUrl = $request->url(null, 'editor', 'notifyBookForReviewMailed', $bookId, array('returnPage' => $returnPage));
 Lines 908-914   class BooksForReviewEditorHandler extends Handler { Link Here 
908
					);
908
					);
909
909
910
					$email->addRecipient($userEmail, $userFullName);
910
					$email->addRecipient($userEmail, $userFullName);
911
					$email->setFrom($book->getEditorEmail(), $book->getEditorFullName());
911
					$email->setReplyTo($book->getEditorEmail(), $book->getEditorFullName());
912
					$email->assignParams($paramArray);
912
					$email->assignParams($paramArray);
913
				}
913
				}
914
				$returnUrl = $request->url(null, 'editor', 'removeBookForReviewAuthor', $bookId, array('returnPage' => $returnPage));
914
				$returnUrl = $request->url(null, 'editor', 'removeBookForReviewAuthor', $bookId, array('returnPage' => $returnPage));
(-)a/plugins/generic/sword/SwordPlugin.inc.php (-3 / +1 lines)
 Lines 165-174   class SwordPlugin extends GenericPlugin { Link Here 
165
			$submittingUser =& $sectionEditorSubmission->getUser();
165
			$submittingUser =& $sectionEditorSubmission->getUser();
166
166
167
			import('classes.mail.ArticleMailTemplate');
167
			import('classes.mail.ArticleMailTemplate');
168
			$contactName = $journal->getSetting('contactName');
169
			$contactEmail = $journal->getSetting('contactEmail');
170
			$mail = new ArticleMailTemplate($sectionEditorSubmission, 'SWORD_DEPOSIT_NOTIFICATION', null, null, $journal, true, true);
168
			$mail = new ArticleMailTemplate($sectionEditorSubmission, 'SWORD_DEPOSIT_NOTIFICATION', null, null, $journal, true, true);
171
			$mail->setFrom($contactEmail, $contactName);
169
			$mail->setReplyTo(null);
172
			$mail->addRecipient($submittingUser->getEmail(), $submittingUser->getFullName());
170
			$mail->addRecipient($submittingUser->getEmail(), $submittingUser->getFullName());
173
171
174
			$mail->assignParams(array(
172
			$mail->assignParams(array(
(-)a/plugins/generic/thesis/StudentThesisForm.inc.php (-3 / +3 lines)
 Lines 285-294   class StudentThesisForm extends Form { Link Here 
285
285
286
			import('classes.mail.MailTemplate');
286
			import('classes.mail.MailTemplate');
287
			$mail = new MailTemplate('THESIS_ABSTRACT_CONFIRM');
287
			$mail = new MailTemplate('THESIS_ABSTRACT_CONFIRM');
288
			$mail->setFrom($thesisEmail, "\"" . $thesisName . "\"");
288
			$mail->setReplyTo($thesisEmail, $thesisName);
289
			$mail->assignParams($paramArray);
289
			$mail->assignParams($paramArray);
290
			$mail->addRecipient($thesis->getSupervisorEmail(), "\"" . $supervisorName . "\"");
290
			$mail->addRecipient($thesis->getSupervisorEmail(), $supervisorName);
291
			$mail->addCc($thesis->getStudentEmail(), "\"" . $studentName . "\"");
291
			$mail->addCc($thesis->getStudentEmail(), $studentName);
292
			$mail->send();
292
			$mail->send();
293
		}
293
		}
294
294
(-)a/plugins/importexport/duracloud/lib/DuraCloud-PHP (-1 / +1 lines)
Line 1    Link Here 
1
Subproject commit 31a1192887b7ff70a058ead1353f49be7246dccf
1
Subproject commit 31a1192887b7ff70a058ead1353f49be7246dccf-dirty
(-)a/plugins/importexport/users/UserXMLParser.inc.php (-1 / +1 lines)
 Lines 192-198   class UserXMLParser { Link Here 
192
192
193
			$journalDao =& DAORegistry::getDAO('JournalDAO');
193
			$journalDao =& DAORegistry::getDAO('JournalDAO');
194
			$journal =& $journalDao->getById($this->journalId);
194
			$journal =& $journalDao->getById($this->journalId);
195
			$mail->setFrom($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
195
			$mail->setReplyTo($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
196
		}
196
		}
197
197
198
		for ($i=0, $count=count($this->usersToImport); $i < $count; $i++) {
198
		for ($i=0, $count=count($this->usersToImport); $i < $count; $i++) {
(-)a/plugins/paymethod/manual/ManualPaymentPlugin.inc.php (-1 / +1 lines)
 Lines 125-131   class ManualPaymentPlugin extends PaymethodPlugin { Link Here 
125
				$contactName = $journal->getSetting('contactName');
125
				$contactName = $journal->getSetting('contactName');
126
				$contactEmail = $journal->getSetting('contactEmail');
126
				$contactEmail = $journal->getSetting('contactEmail');
127
				$mail = new MailTemplate('MANUAL_PAYMENT_NOTIFICATION');
127
				$mail = new MailTemplate('MANUAL_PAYMENT_NOTIFICATION');
128
				$mail->setFrom($contactEmail, $contactName);
128
				$mail->setReplyTo(null);
129
				$mail->addRecipient($contactEmail, $contactName);
129
				$mail->addRecipient($contactEmail, $contactName);
130
				$mail->assignParams(array(
130
				$mail->assignParams(array(
131
					'journalName' => $journal->getLocalizedTitle(),
131
					'journalName' => $journal->getLocalizedTitle(),
(-)a/plugins/paymethod/paypal/PayPalPlugin.inc.php (-1 / +1 lines)
 Lines 168-174   class PayPalPlugin extends PaymethodPlugin { Link Here 
168
			$contactEmail = $journal->getSetting('contactEmail');
168
			$contactEmail = $journal->getSetting('contactEmail');
169
		}
169
		}
170
		$mail = new MailTemplate('PAYPAL_INVESTIGATE_PAYMENT');
170
		$mail = new MailTemplate('PAYPAL_INVESTIGATE_PAYMENT');
171
		$mail->setFrom($contactEmail, $contactName);
171
		$mail->setReplyTo(null);
172
		$mail->addRecipient($contactEmail, $contactName);
172
		$mail->addRecipient($contactEmail, $contactName);
173
173
174
		$paymentStatus = $request->getUserVar('payment_status');
174
		$paymentStatus = $request->getUserVar('payment_status');
(-)a/registry/journalSettings.xml (+4 lines)
 Lines 51-56    Link Here 
51
		<value>{translate key="default.journalSettings.copyeditInstructions"}</value>
51
		<value>{translate key="default.journalSettings.copyeditInstructions"}</value>
52
	</setting>
52
	</setting>
53
	<setting type="string" locale="0">
53
	<setting type="string" locale="0">
54
		<name>emailHeader</name>
55
		<value>{translate key="default.journalSettings.emailHeader"}</value>
56
	</setting>
57
	<setting type="string" locale="0">
54
		<name>emailSignature</name>
58
		<name>emailSignature</name>
55
		<value>{translate key="default.journalSettings.emailSignature"}</value>
59
		<value>{translate key="default.journalSettings.emailSignature"}</value>
56
	</setting>
60
	</setting>
(-)a/templates/editor/notifyUsersEmail.tpl (+3 lines)
 Lines 1-3    Link Here 
1
{literal}{$templateHeader}{/literal}
2
1
{$body}
3
{$body}
2
4
3
{$journal->getLocalizedTitle()|strip_tags}
5
{$journal->getLocalizedTitle()|strip_tags}
 Lines 9-14    Link Here 
9
{if $section.title}{$section.title}{/if}
11
{if $section.title}{$section.title}{/if}
10
12
11
--------
13
--------
14
{literal}{$templateHeader}{/literal}
12
{foreach from=$section.articles item=article}
15
{foreach from=$section.articles item=article}
13
{$article->getLocalizedTitle()|strip_tags}{if $article->getPages()} ({$article->getPages()}){/if}
16
{$article->getLocalizedTitle()|strip_tags}{if $article->getPages()} ({$article->getPages()}){/if}
14
17
(-)a/templates/manager/people/email.tpl (-4 lines)
 Lines 136-145   function deleteAttachment(fileId) { Link Here 
136
	<td colspan="2">&nbsp;</td>
136
	<td colspan="2">&nbsp;</td>
137
</tr>
137
</tr>
138
<tr valign="top">
138
<tr valign="top">
139
	<td class="label">{translate key="email.from"}</td>
140
	<td class="value">{$from|escape}</td>
141
</tr>
142
<tr valign="top">
143
	<td width="20%" class="label">{fieldLabel name="subject" key="email.subject"}</td>
139
	<td width="20%" class="label">{fieldLabel name="subject" key="email.subject"}</td>
144
	<td width="80%" class="value"><input type="text" id="subject" name="subject" value="{$subject|escape}" size="60" maxlength="120" class="textField" /></td>
140
	<td width="80%" class="value"><input type="text" id="subject" name="subject" value="{$subject|escape}" size="60" maxlength="120" class="textField" /></td>
145
</tr>
141
</tr>
(-)a/templates/manager/setup/step1.tpl (+7 lines)
 Lines 143-148    Link Here 
143
<div id="setupEmails">
143
<div id="setupEmails">
144
<h3>1.4 {translate key="manager.setup.emails"}</h3>
144
<h3>1.4 {translate key="manager.setup.emails"}</h3>
145
<table width="100%" class="data">
145
<table width="100%" class="data">
146
	<tr valign="top"><td colspan="2">{translate key="manager.setup.emailHeaderDescription"}<br />&nbsp;</td></tr>
147
	<tr valign="top">
148
		<td class="label">{fieldLabel name="emailHeader" key="manager.setup.emailHeader"}</td>
149
		<td class="value">
150
			<textarea name="emailHeader" id="emailHeader" rows="3" cols="60" class="textArea">{$emailHeader|escape}</textarea>
151
		</td>
152
	</tr>
146
	<tr valign="top"><td colspan="2">{translate key="manager.setup.emailSignatureDescription"}<br />&nbsp;</td></tr>
153
	<tr valign="top"><td colspan="2">{translate key="manager.setup.emailSignatureDescription"}<br />&nbsp;</td></tr>
147
	<tr valign="top">
154
	<tr valign="top">
148
		<td class="label">{fieldLabel name="emailSignature" key="manager.setup.emailSignature"}</td>
155
		<td class="label">{fieldLabel name="emailSignature" key="manager.setup.emailSignature"}</td>
(-)a/templates/rt/email.tpl (-4 lines)
 Lines 145-154   function deleteAttachment(fileId) { Link Here 
145
	<td colspan="2">&nbsp;</td>
145
	<td colspan="2">&nbsp;</td>
146
</tr>
146
</tr>
147
<tr valign="top">
147
<tr valign="top">
148
	<td class="label">{translate key="email.from"}</td>
149
	<td class="value">{$from|escape}</td>
150
</tr>
151
<tr valign="top">
152
	<td width="20%" class="label">{fieldLabel name="subject" key="email.subject"}</td>
148
	<td width="20%" class="label">{fieldLabel name="subject" key="email.subject"}</td>
153
	<td width="80%" class="value"><input type="text" id="subject" name="subject" value="{$subject|escape}" size="50" maxlength="120" class="textField" /></td>
149
	<td width="80%" class="value"><input type="text" id="subject" name="subject" value="{$subject|escape}" size="50" maxlength="120" class="textField" /></td>
154
</tr>
150
</tr>
(-)a/templates/subscription/openAccessNotifyEmail.tpl (+3 lines)
 Lines 4-9    Link Here 
4
Content-Type: text/plain; charset={$defaultCharset|escape}
4
Content-Type: text/plain; charset={$defaultCharset|escape}
5
Content-Transfer-Encoding: quoted-printable
5
Content-Transfer-Encoding: quoted-printable
6
6
7
{literal}{$templateHeader}{/literal}
7
{$body}
8
{$body}
8
9
9
{$issue->getIssueIdentification()}
10
{$issue->getIssueIdentification()}
 Lines 42-47   Content-Transfer-Encoding: quoted-printable Link Here 
42
		</head>
43
		</head>
43
	<body>
44
	<body>
44
45
46
	<pre>{literal}{$templateHeader}{/literal}</pre>
47
45
	<p>{$body|escape|nl2br}</p>
48
	<p>{$body|escape|nl2br}</p>
46
49
47
		<h3>{$issue->getIssueIdentification()}<br />{translate key="issue.toc"}</h3>
50
		<h3>{$issue->getIssueIdentification()}<br />{translate key="issue.toc"}</h3>

Return to bug 8085