Table of Contents

Mailer Settings

"from" email address

${drush_cmd} -y cvapi OptionValue.create option_group_id="from_email_address" label="\"Friends of Israel Scouts\" <>" is_default=1

Default Mailbox

first delete the EXAMPLE.ORG record for the new domain so we don't have two default boxes

DELETE FROM `civicrm_mail_settings` WHERE `domain_id` = ${domain_id} AND `is_default` = 1;
INSERT INTO civicrm_mail_settings (`domain_id`, `name`, `is_default`, `domain`, `localpart`, `return_path`, `protocol`, `server`, `port`, `username`, `password`, `is_ssl`, `source`)
SELECT ${domain_id}, 'default', true, `domain`, `localpart`, `return_path`, `protocol`, `server`, `port`, `username`, `password`, `is_ssl`, `source`
FROM civicrm_mail_settings
WHERE `domain_id` = 1;

SparkPost Settings

copy from the main domain

INSERT INTO `civicrm_setting` (`name`, `value`, `domain_id`, `contact_id`, `is_domain`, `component_id`, `created_date`, `created_id`) 
SELECT `name`, `value`, ${domain_id}, `contact_id`, `is_domain`, `component_id`, NOW(), `created_id`
FROM `civicrm_setting`
WHERE `domain_id` = 1
AND `name` IN ('sparkpost_apiKey', 'sparkpost_ipPool', 'sparkpost_useBackupMailer')