本文整理汇总了PHP中CRM_Mailing_DAO_Mailing::save方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Mailing_DAO_Mailing::save方法的具体用法?PHP CRM_Mailing_DAO_Mailing::save怎么用?PHP CRM_Mailing_DAO_Mailing::save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Mailing_DAO_Mailing
的用法示例。
在下文中一共展示了CRM_Mailing_DAO_Mailing::save方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
/**
* function to add the mailings
*
* @param array $params reference array contains the values submitted by the form
* @param array $ids reference array contains the id
*
* @access public
* @static
* @return object
*/
static function add(&$params, &$ids)
{
require_once 'CRM/Utils/Hook.php';
if (CRM_Utils_Array::value('mailing', $ids)) {
CRM_Utils_Hook::pre('edit', 'Mailing', $ids['mailing_id'], $params);
} else {
CRM_Utils_Hook::pre('create', 'Mailing', null, $params);
}
$mailing = new CRM_Mailing_DAO_Mailing();
$mailing->id = CRM_Utils_Array::value('mailing_id', $ids);
if (!isset($params['replyto_email']) && isset($params['from_email'])) {
$params['replyto_email'] = $params['from_email'];
}
$mailing->copyValues($params);
$result = $mailing->save();
if (CRM_Utils_Array::value('mailing', $ids)) {
CRM_Utils_Hook::post('edit', 'Mailing', $mailing->id, $mailing);
} else {
CRM_Utils_Hook::post('create', 'Mailing', $mailing->id, $mailing);
}
return $result;
}
示例2: add
/**
* function to add the mailings
*
* @param array $params reference array contains the values submitted by the form
* @param array $ids reference array contains the id
*
* @access public
* @static
*
* @return object
*/
static function add(&$params, $ids = array())
{
$id = CRM_Utils_Array::value('mailing_id', $ids, CRM_Utils_Array::value('id', $params));
if ($id) {
CRM_Utils_Hook::pre('edit', 'Mailing', $id, $params);
} else {
CRM_Utils_Hook::pre('create', 'Mailing', NULL, $params);
}
$mailing = new CRM_Mailing_DAO_Mailing();
$mailing->id = $id;
$mailing->domain_id = CRM_Utils_Array::value('domain_id', $params, CRM_Core_Config::domainID());
if (!isset($params['replyto_email']) && isset($params['from_email'])) {
$params['replyto_email'] = $params['from_email'];
}
$mailing->copyValues($params);
$result = $mailing->save();
if (CRM_Utils_Array::value('mailing', $ids)) {
CRM_Utils_Hook::post('edit', 'Mailing', $mailing->id, $mailing);
} else {
CRM_Utils_Hook::post('create', 'Mailing', $mailing->id, $mailing);
}
return $result;
}
示例3: upgrade_4620
/**
* Example: Run an external SQL script
*
* @return TRUE on success
* @throws Exception
*/
public function upgrade_4620()
{
$this->ctx->log->info('Applying update for version 2.0');
$mail = new CRM_Mailing_DAO_Mailing();
$mail->domain_id = CRM_Core_Config::domainID();
$mail->subject = "***All Transactional Emails***";
$mail->url_tracking = TRUE;
$mail->forward_replies = FALSE;
$mail->auto_responder = FALSE;
$mail->open_tracking = TRUE;
if ($mail->find(TRUE)) {
$mail->name = ts('Transaction Emails');
$mail->save();
}
$url = CRM_Utils_System::url('civicrm/mte/smtp', 'reset=1', TRUE, NULL, FALSE, TRUE);
CRM_Core_Session::setStatus(ts("Update the <a href={$url}>Mandrill settings</a> to configure it to use for Transactional Email and/or Civi Bulk Mail."));
return TRUE;
}