]> gitweb.fluxo.info Git - drupal/reminder.git/commitdiff
Starting to implement hook_mail()
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 6 Sep 2012 00:47:02 +0000 (21:47 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 6 Sep 2012 00:47:02 +0000 (21:47 -0300)
reminder.module

index 0acb74d9524a1f2d018750a54f873ef474cd74fa..60a24bad51a93f807578d7014b404145d70c6e7c 100644 (file)
@@ -185,7 +185,7 @@ function reminder_form(&$node) {
      '#date_format'         => isset($reminder['until']) ? $reminder['until'] : $format_until,
      '#date_label_position' => 'within',
      '#date_increment'      => 60,
-     '#date_year_range'     => '0:+3',
+     '#date_year_range'     => '0:+20',
   );
 
   $form['frequency'] = array(
@@ -384,6 +384,28 @@ function reminder_node_submit($node, $form, &$form_state) {
   drupal_set_message(t("Saved."));
 }
 
+/**
+ * Implements hook_mail()
+ *
+ * @todo
+ */
+function reminder_mail($key, &$message, $params) {
+   $account   = $params['account'];
+   $context   = $params['context'];
+   $variables = array(
+     '%site_name' => variable_get('site_name', 'Drupal'),
+     '%username'  => format_username($account),
+   );
+
+   $subject             = strtr($context['subject'], $variables);
+   $body                = strtr($context['message'], $variables);
+   $message['subject'] .= str_replace(array("\r", "\n"), '', $subject);
+   $message['body'][]   = drupal_html_to_text($body);
+
+   if ($key == 'create_new_reminder') {
+   }
+}
+
 /**
  * Implementation of hook_node_delete()
  */
@@ -401,7 +423,7 @@ function reminder_delete($node) {
  *   Send periodic emails.
  */
 function reminder_cron() {
-   variable_set('reminder_cron_last_run', REQUEST_TIME);
+  variable_set('reminder_cron_last_run', REQUEST_TIME);
 }
 
 /**