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

Towards CRM-17753 - consolidate code location for do-not-reply@mydomain.com #12270

Merged
merged 1 commit into from
Jun 19, 2018

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Jun 6, 2018

Overview

#10648 and #10647 both seek to prevent the mailing out of emails with from being do-not-reply@mydomain.com which is bad practice. They are stalled on agreement on what the correct alternative is and on the need to consolidate the code to be able to make the change sensibly. This does the latter - ie. consolidates the code for a change but does not make one.

Before

do not reply address constructed in multiple places

After

do not reply constructed in only one (it would be possible to go further & also return the longer variant with the <> part but that can follow as a wrapper function later.

Technical Details

In terms of the bigger picture I would suggest that we use the civicrm_mail_settings table & store another type - although there might be a case for option value or setting

Comments


@civibot
Copy link

civibot bot commented Jun 6, 2018

(Standard links)

@@ -143,11 +143,11 @@ public static function confirm($contact_id, $subscribe_id, $hash) {
$mailParams = array(
'groupName' => 'Mailing Event ' . $component->component_type,
'subject' => $component->subject,
'from' => "\"$domainEmailName\" <do-not-reply@$emailDomain>",
'from' => "\"$domainEmailName\" <" . CRM_Core_BAO_Domain::getNoReplyEmailAddress() . '>',
Copy link
Member

Choose a reason for hiding this comment

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

@eileenmcnaughton you need to remove

$emailDomain = CRM_Core_BAO_MailSettings::defaultDomain();

above at line 121

@@ -189,7 +189,7 @@ public static function send($queue_id, &$mailing, &$bodyTxt, $replyto, &$bodyHTM
'To' => $mailing->replyto_email,
'From' => $from,
'Reply-To' => empty($replyto) ? $eq->email : $replyto,
'Return-Path' => "do-not-reply@{$emailDomain}",
'Return-Path' => CRM_Core_BAO_Domain::getNoReplyEmailAddress(),
Copy link
Member

Choose a reason for hiding this comment

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

@eileenmcnaughton you need to remove

$emailDomain = CRM_Core_BAO_MailSettings::defaultDomain();

above at line 176

@@ -227,7 +227,7 @@ public function send_confirm_request($email) {
'From' => "\"{$domainEmailName}\" <{$domainEmailAddress}>",
'To' => $email,
'Reply-To' => $confirm,
'Return-Path' => "do-not-reply@$emailDomain",
'Return-Path' => CRM_Core_BAO_Domain::getNoReplyEmailAddress(),
Copy link
Member

Choose a reason for hiding this comment

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

@eileenmcnaughton you need to remove

$emailDomain = CRM_Core_BAO_MailSettings::defaultDomain();

above at line 203

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the others - but this one is still used

Copy link
Member

Choose a reason for hiding this comment

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

Oh ok

@eileenmcnaughton
Copy link
Contributor Author

@monishdeb is this mergeable now?

@seamuslee001
Copy link
Contributor

(CiviCRM Review Template WORD-1.1)

  • (r-explain) Pass
  • (r-test) Pass
  • (r-code) Pass
  • (r-doc) Pass
  • (r-maint) Pass
  • (r-run) Pass happy with unit testing to pass to verify that this is giving ok output and reviewing the code all the changes are contained and make sense
  • (r-user) Pass
  • (r-tech) Pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants