Created
February 13, 2017 19:40
-
-
Save mlutfy/8a151e6c0f028dd9eba44dccd24a40c4 to your computer and use it in GitHub Desktop.
civicrm send to a friend sparkpost fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_civicrm_alterMailParams(). | |
* | |
* Intercepts outgoing emails. | |
*/ | |
function myext_civicrm_alterMailParams(&$params) { | |
// redmine:20627 Quickfix for PCP "send to a friend" enforce the 'from' email. | |
if ($params['valueName'] == 'friend') { | |
if (preg_match('/<([^>]+)>/', $params['from'], $matches)) { | |
$orig_from = $matches[1]; | |
$params['from'] = str_replace($orig_from, 'no-reply@example.org', $params['from']); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👍