function mailing_list_email_save in Mailing List 7
Saves a mailing_list_email record to the database.
Parameters
StdClass $mailing_list_email: An object with the following fields
- eid (optional): Primary key to save to in case of an update.
- mlid: The mailing list ID to save to.
- mail: The email to save.
- name (optional): Name to store with the email.
Return value
unknown_type
2 calls to mailing_list_email_save()
- mailing_list_import_form_submit in ./
mailing_list.admin.inc - Submit handler for the mailing list import form.
- mailing_list_subscription_form_submit in ./
mailing_list.module - Submit handler for the subscription form; saves a subscription.
File
- ./
mailing_list.module, line 311 - Minimalistic mailing list module.
Code
function mailing_list_email_save(&$mailing_list_email) {
$update = array();
if (is_object($mailing_list_email)) {
$mailing_list_email = (array) $mailing_list_email;
}
if (!empty($mailing_list_email['eid'])) {
$update = array(
'eid',
);
}
return drupal_write_record('mailing_list_emails', $mailing_list_email, $update);
}