You are here

function mailsystem_set in Mail System 7.3

Same name and namespace in other branches
  1. 8 mailsystem.module \mailsystem_set()
  2. 8.2 mailsystem.module \mailsystem_set()
  3. 6.2 mailsystem.module \mailsystem_set()
  4. 6 mailsystem.module \mailsystem_set()
  5. 7 mailsystem.module \mailsystem_set()
  6. 7.2 mailsystem.module \mailsystem_set()

Helps other modules safely set their own key within mail_system.

This function should be called from hook_enable() implementations.

Parameters

array $setting: An associative array ($id => $value) where:

  • $id is the machine-readable module name optionally followed by '_' and a key.
  • $value is one of
    • (string) The name of a class that implements MailSystemInterface.
    • (array) An associative array whose keys are the names of methods defined by MailSystemInterface and whose values are the names of the class to use for that method.

See also

drupal_mail()

2 calls to mailsystem_set()
mailsystem_admin_save_custom_setting in ./mailsystem.admin.inc
Helper function. Writes the setting values for a given mail-id.
mailsystem_update_7300 in ./mailsystem.install
Remove dynamically generated mailsystem classes and convert configuration.

File

./mailsystem.module, line 124
Provide UI for controlling the mail_system variable.

Code

function mailsystem_set(array $setting) {
  $mail_system = mailsystem_get();
  foreach ($setting as $key => $class) {
    variable_del("mailsystem_delegate:{$key}");
    if (is_array($class)) {

      // Save the settings for our delegateer-class into a variable.
      $setting[$key] = mailsystem_delegate_set_mailsystem_settings($key, $class);
    }
  }
  variable_set('mail_system', array_merge(mailsystem_get(), $setting));
}