Gooseberry - Alternative Mailer for CiviCRM
Extension provides handling mailer objects in CiviCRM for transactional emails (not CiviMail!).
There is only page displaying current settings, on url civicrm/gooseberry/settings.
Assumptions:
mailing_backend_alternate[1-2]
,mailing_backend_alternate1
,mailing_backend_alternate2
,gooseberry
is stored which mailer will be used,hook_civicrm_alterMailer()
.The extension rewrites $mailer
object in hook_civicrm_alterMailParams()
. Remember that CiviMail doesn’t use this hook, so it’s not possible to change setting for CiviMail by this extension. Instead of this CiviMail uses default setting mailing_backend
provided by page Outbound Mail.
This works only when Outbound Mail is set to any STMP server.
This works only for $context = 'singleEmail'
.
INSERT INTO civicrm_setting (name, value, domain_id, contact_id, is_domain, component_id, created_date, created_id)
SELECT 'mailing_backend_alternate1', value, domain_id, contact_id, is_domain, component_id, created_date, created_id
FROM civicrm_setting WHERE name = 'mailing_backend';
There are two ways for switch on:
$params['gooseberry'] = 1; // during preparing params for method CRM_Utils_Mail::send()
groupName
in settings reGroupName*
as a list of regular expressions. Use sql query to insert or update, for example:UPDATE civicrm_setting
SET value = ‘s”/Scheduled Reminder Sender/||/Activity Email Sender/||/Report Email Sender/||/Mailing Event .*/“;’
WHERE name = ‘reGroupName1’;
UPDATE civicrm_setting
SET value = ‘s””;’
WHERE name = ‘reGroupName1’;
```
Emails from reGroupName1
uses mailing_backend_alternate1
configuration.
Thanks to value of session variable gooseberry
extension decides which alternative mailer will be used.
0
- use default SMTP server (this depends on mailing_backend
),1
- use first alternative SMTP server,2
- use second alternative SMTP server.