aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2012-09-05 21:47:02 -0300
committerSilvio Rhatto <rhatto@riseup.net>2012-09-05 21:47:02 -0300
commitaabc235e31c028c30c899b495871f47d8719aa3d (patch)
tree876632a0a9f37fcf8076b5f078f544eb07a488ab
parentd51d58ed6f16ccb8cfd0f3e4252a320fbee13734 (diff)
downloadreminder-aabc235e31c028c30c899b495871f47d8719aa3d.tar.gz
reminder-aabc235e31c028c30c899b495871f47d8719aa3d.tar.bz2
Starting to implement hook_mail()
-rw-r--r--reminder.module26
1 files changed, 24 insertions, 2 deletions
diff --git a/reminder.module b/reminder.module
index 0acb74d..60a24ba 100644
--- a/reminder.module
+++ b/reminder.module
@@ -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(
@@ -385,6 +385,28 @@ function reminder_node_submit($node, $form, &$form_state) {
}
/**
+ * 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()
*/
function reminder_delete($node) {
@@ -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);
}
/**