),
'unsubscribe_url' => array(
'type' => 'varchar',
- 'length' => 25,
+ 'length' => 30,
'not null' => TRUE,
'default' => ''
),
)
);
}
+
+/**
+ * Increase unsubscribe_url size.
+ */
+function reminder_update_7003(&$sandbox) {
+ db_change_field('reminder_subscriptions', 'unsubscribe_url', 'unsubscribe_url',
+ array(
+ 'type' => 'varchar',
+ 'length' => 30,
+ 'not null' => TRUE,
+ 'default' => ''
+ )
+ );
+}
* Date, remind and subscribe widgets.
* Update subscribers, removing old ones.
* Optionally send unsubscription email for removed users.
+ * Redirect to reminder page.
*/
function reminder_node_submit($node, $form, &$form_state) {
global $user;
'reminder_id' => $node->nid,
'unsubscribe_url' => $unsubscribe_url,
);
- }
- $query = db_insert('reminder_subscriptions')->fields($values);
+ $query = db_insert('reminder_subscriptions')->fields($values)->execute();
+ }
}
else {
// Fetch existing options.
* @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);
+ $subject = t('Reminder information');
+ $body = t('Reminder URL: @url', array('@url' => $params['reminder_url']));
$message['subject'] .= str_replace(array("\r", "\n"), '', $subject);
$message['body'][] = drupal_html_to_text($body);