mandrill.variable.inc 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <?php
  2. /**
  3. * @file
  4. * Mandrill variable hooks.
  5. */
  6. /**
  7. * Implements hook_variable_group_info().
  8. */
  9. function mandrill_variable_group_info() {
  10. $groups['mandrill'] = array(
  11. 'title' => t('Mandrill'),
  12. 'description' => t('Settings related to Mandrill.'),
  13. 'access' => 'administer mandrill',
  14. 'path' => array('admin/config/services/mandrill'),
  15. );
  16. return $groups;
  17. }
  18. /**
  19. * Implements hook_variable_info().
  20. */
  21. function mandrill_variable_info($options) {
  22. $variables = array();
  23. $variables['mandrill_api_key'] = array(
  24. 'title' => t('Mandrill API Key', array(), $options),
  25. 'description' => t('Create or grab your API key from the !link.',
  26. array('!link' => l(t('Mandrill settings'), 'https://mandrillapp.com/settings/index')),
  27. $options),
  28. 'type' => 'string',
  29. 'group' => 'mandrill',
  30. 'default' => variable_get('site_mail'),
  31. );
  32. $variables['mandrill_from'] = array(
  33. 'title' => t('From address', array(), $options),
  34. 'description' => t('The sender email address. If this address has not been verified, messages will be queued and not sent until it is.', array(), $options),
  35. 'type' => 'string',
  36. 'group' => 'mandrill',
  37. 'default' => '',
  38. );
  39. $variables['mandrill_from_name'] = array(
  40. 'title' => t('From name', array(), $options),
  41. 'description' => t('Optionally enter a from name to be used.', array(), $options),
  42. 'type' => 'string',
  43. 'group' => 'mandrill',
  44. 'default' => '',
  45. );
  46. $formats = filter_formats();
  47. $mandrill_filter_format_options = array();
  48. foreach ($formats as $v => $format) {
  49. $mandrill_filter_format_options[$v] = $format->name;
  50. }
  51. $variables['mandrill_filter_format'] = array(
  52. 'title' => t('Input format', array(), $options),
  53. 'description' => t('If selected, the input format to apply to the message body before sending to the Mandrill API.', array(), $options),
  54. 'type' => 'select',
  55. 'options' => $mandrill_filter_format_options,
  56. 'group' => 'mandrill',
  57. 'default' => 'full_html',
  58. );
  59. $variables['mandrill_track_opens'] = array(
  60. 'title' => t('Track opens', array(), $options),
  61. 'description' => t('Whether or not to turn on open tracking for messages.', array(), $options),
  62. 'type' => 'boolean',
  63. 'group' => 'mandrill',
  64. 'default' => TRUE,
  65. );
  66. $variables['mandrill_track_clicks'] = array(
  67. 'title' => t('mandrill_track_clicks', array(), $options),
  68. 'description' => t('Whether or not to turn on click tracking for messages.', array(), $options),
  69. 'type' => 'boolean',
  70. 'group' => 'mandrill',
  71. 'default' => TRUE,
  72. );
  73. $variables['mandrill_url_strip_qs'] = array(
  74. 'title' => t('Strip query string', array(), $options),
  75. 'description' => t('Whether or not to strip the query string from URLs when aggregating tracked URL data.', array(), $options),
  76. 'type' => 'boolean',
  77. 'group' => 'mandrill',
  78. 'default' => FALSE,
  79. );
  80. $variables['mandrill_mail_key_blacklist'] = array(
  81. 'title' => t('Content logging blacklist', array(), $options),
  82. 'description' => t('Comma delimited list of Drupal mail keys to exclude content logging for. CAUTION: Removing the default password reset key may expose a security risk.', array(), $options),
  83. 'type' => 'text',
  84. 'group' => 'mandrill',
  85. 'default' => mandrill_mail_key_blacklist(),
  86. );
  87. $variables['mandrill_analytics_domains'] = array(
  88. 'title' => t('Google analytics domains', array(), $options),
  89. 'description' => t('One or more domains for which any matching URLs will automatically have Google Analytics parameters appended to their query string. Separate each domain with a comma.', array(), $options),
  90. 'type' => 'string',
  91. 'group' => 'mandrill',
  92. 'default' => '',
  93. );
  94. $variables['mandrill_analytics_campaign'] = array(
  95. 'title' => t('Google analytics campaign', array(), $options),
  96. 'description' => t("The value to set for the utm_campaign tracking parameter. If this isn't provided the messages from address will be used instead.", array(), $options),
  97. 'type' => 'string',
  98. 'group' => 'mandrill',
  99. 'default' => '',
  100. );
  101. return $variables;
  102. }