Skip to content

Commit

Permalink
Make it configurable to store email body in Activity. WIP.
Browse files Browse the repository at this point in the history
  • Loading branch information
xurizaemon committed Sep 5, 2017
1 parent 0bd3084 commit 60f5a93
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
12 changes: 10 additions & 2 deletions CRM/Mte/BAO/Mandrill.php
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,17 @@ public static function createActivity($value, $context = NULL, &$header = array(
'version' => 3,
'target_contact_id' => array_unique($emails['contactIds']),
'source_record_id' => CRM_Utils_Array::value('mailing_id', $value),
'details' => CRM_Utils_Array::value('mail_body', $value),
'details' => null,
);


$mailingBackend = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
'mandrill_smtp_settings'
);
Civi::log()->debug(print_r(['$mailingBackend' => $mailingBackend]));
if (false) {
$activityParams['details'] = CRM_Utils_Array::value('mail_body', $value);
}

if (CRM_Utils_Array::value('assignee_contact_id', $value)) {
$activityParams['assignee_contact_id'] = array_unique($value['assignee_contact_id']);
}
Expand Down
1 change: 1 addition & 0 deletions CRM/Mte/Form/MandrillSmtpSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ function buildQuickForm() {
NULL, NULL, NULL, NULL,
array('&nbsp;&nbsp;', '&nbsp;&nbsp;', '<br/>')
);
$this->add('checkbox', 'activity_includes_mail_body', ts('Save email body to Activities?'));

$element = $this->add('text', 'mandril_post_url', ts('Mandrill Post to URL'));
$element->freeze();
Expand Down
5 changes: 5 additions & 0 deletions templates/CRM/Mte/Form/MandrillSmtpSetting.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ There are two types of emails sent from CiviCRM: bulk emails sent through the Ci
<span class="description">{ts}{/ts}</span>
</td>
</tr>
<tr class="crm-smtp-form-block-activity_includes_mail_body">
<td class="label">{$form.activity_includes_mail_body.label}</td>
<td>{$form.activity_includes_mail_body.html}<br />
</td>
</tr>
<tr class="crm-smtp-form-block-enable">
<td class="label">{$form.is_active.label}</td>
<td>{$form.is_active.html}<br />
Expand Down

0 comments on commit 60f5a93

Please sign in to comment.