diff --git ecard/ecard.module ecard/ecard.module
index ba7476f..fe8613f 100644
--- ecard/ecard.module
+++ ecard/ecard.module
@@ -143,7 +143,7 @@ function ecard_admin() {
   $form['letter']['ecard_subject'] = array(
       '#type' => 'textfield',
       '#title' => t('Subject'),
-      '#default_value' => variable_get('ecard_subject', 'E-card from %site'),
+      '#default_value' => variable_get('ecard_subject', 'E-card from [site-name]'),
       '#size' => 70,
       '#maxlength' => 70,
       '#description' => t('Customize the subject for e-card'),
@@ -154,7 +154,17 @@ function ecard_admin() {
       '#default_value' => variable_get('ecard_letter', _ecard_letter()),
       '#cols' => 70,
       '#rows' => 5,
-      '#description' => t('This text is the body of the email that the e-card recipient will see. These are the variables you may use: %site = your site name, %site_url = your site URL, %site_mail = your site email address, %card_url = the URL for the e-card, %sender = sender name, %sender_email = sender email, %recipient = recipient email'),
+      '#description' => t('This text is the body of the email that the e-card recipient will see.'),
+  );
+
+  $form['letter']['token'] = array(
+    '#collapsed'      => TRUE,
+    '#collapsible'    => TRUE,
+    '#title'          => t('Replacement values'),
+    '#type'           => 'fieldset',
+  );
+  $form['letter']['token']['token_help'] = array(
+    '#value' => theme('token_help', 'ecard-mail'),
   );
 
   $form['copy'] = array(
@@ -182,7 +192,16 @@ function ecard_admin() {
       '#default_value' => variable_get('ecard_copy', _ecard_copy()),
       '#cols' => 70,
       '#rows' => 5,
-      '#description' => t('This text is the body of the email to notify the sender that his e-card has been picked up. These are the variables you may use: %site = your site name, %site_url = your site URL, %site_mail = your site email address, %card_url = the URL for the e-card'),
+      '#description' => t('This text is the body of the email to notify the sender that his e-card has been picked up.'),
+  );
+  $form['copy']['token'] = array(
+    '#collapsed'      => TRUE,
+    '#collapsible'    => TRUE,
+    '#title'          => t('Replacement values'),
+    '#type'           => 'fieldset',
+  );
+  $form['copy']['token']['token_help'] = array(
+    '#value' => theme('token_help', 'ecard-copy'),
   );
 
   $form['notify'] = array(
@@ -210,7 +229,16 @@ function ecard_admin() {
       '#default_value' => variable_get('ecard_notify', _ecard_notify()),
       '#cols' => 70,
       '#rows' => 5,
-      '#description' => t('This text is the body of the email to notify the sender that the e-card has been picked up. These are the variables you may use: %site = your site name, %site_url = your site URL, %site_mail = your site email address, %card_url = the URL for the e-card, %sender = sender name, %recipient = recipient email'),
+      '#description' => t('This text is the body of the email to notify the sender that the e-card has been picked up.'),
+  );
+  $form['notify']['token'] = array(
+    '#collapsed'      => TRUE,
+    '#collapsible'    => TRUE,
+    '#title'          => t('Replacement values'),
+    '#type'           => 'fieldset',
+  );
+  $form['notify']['token']['token_help'] = array(
+    '#value' => theme('token_help', 'ecard-notify'),
   );
 
   $form['array_filter'] = array('#type' => 'hidden');
@@ -237,10 +265,10 @@ function _ecard_letter() {
   $output = t(
       "Hi,
 
-%sender made an e-card for you.
+[ecard-sender-name] made an e-card for you.
 At any time you may see your card by clicking this link:
 
-%card_url
+[ecard-card-url]
 
 (if your email client doesn't allow you to click on the site link,
 then just copy and paste the URL into your browser)
@@ -469,10 +497,9 @@ function ecard_send_card($ecard) {
     $ecard->recp_mail = $email;
     ecard_save_card($ecard);
 
-    $params['card'] = $base .'ecard/view/'. $cardid;
-    $params['sender'] = $ecard->sender_name;
-    $params['sendermail'] = $ecard->sender_email;
-    $params['recipient'] = $email;
+    $params = (array) $ecard;
+    $params['card_url'] = $base .'ecard/view/'. $cardid;
+    $params['recipient_mail'] = $email;
     drupal_mail('ecard', 'ecard-mail', $email, $language, $params, $ecard->sender_email);
   }
 
@@ -488,7 +515,8 @@ function ecard_send_card($ecard) {
     $card_copy_url = url('ecard/view/'. $ecard->random, array('absolute' => true));
     drupal_set_message(t('You can view the e-card at <a href="!url">here</a>.', array('!url' => $card_copy_url)));
 
-    $params['card_copy'] = $card_copy_url;
+    $params = (array) $ecard;
+    $params['card_url'] = $card_copy_url;
     drupal_mail('ecard', 'ecard-copy', $ecard->sender_email, $language, $params, variable_get('site_mail', ini_get('sendmail_from')));
   }
 }
@@ -500,7 +528,7 @@ function _ecard_copy() {
   $output = t(
       "Hi,
 Here is the copy of your message you send
-%card_url
+[ecard-card-url]
 
 (if your email client doesn't allow you to click on the site link,
 then just copy and paste the URL into your browser)
@@ -515,9 +543,9 @@ function _ecard_notify() {
   $output = t(
       "Hi,
 
-%recipient has picked up your e-card today.
+[ecard-recipient-mail] has picked up your e-card today.
 Here is the url to your e-card
-%card_url
+[ecard-card-url]
 
 (if your email client doesn't allow you to click on the site link,
 then just copy and paste the URL into your browser)
@@ -596,11 +624,9 @@ function ecard_view($arg1 = NULL) {
 
         // Make message.
         $site_email = variable_get('site_mail', ini_get('sendmail_from'));
-        $params['site'] = $site_email;
+        $params = (array) $ecard;
         $params['card_url'] = $card_url;
-        $params['sender'] = $ecard->sender_name;
-        $params['recipient'] = $ecard->recp_mail;
-        $params['sender_email'] = $ecard->sender_email;
+        $params['recipient_mail'] = $ecard->recp_mail;
         drupal_mail('ecard', 'ecard-notify', $params['sender_email'], NULL, $params, $site_email);
         db_query("UPDATE {ecard} SET notify='n' WHERE random='%s'", $ecard->random);
       }
@@ -616,52 +642,59 @@ function ecard_view($arg1 = NULL) {
 }
 
 /**
+ * Implementation of hook_token_list().
+ */
+function ecard_token_list($type = 'all') {
+  if (in_array($type, array('all', 'ecard-mail', 'ecard-notify', 'ecard-copy'))) {
+    $tokens['ecard']['ecard-sender-name'] = t('The name of the sender.');
+    $tokens['ecard']['ecard-sender-mail'] = t('The e-mail address of the sender.');
+    $tokens['ecard']['ecard-card-url'] = t('The full URL of the e-card.');
+  }
+  if (in_array($type, array('all', 'ecard-mail', 'ecard-notify'))) {
+    $tokens['ecard']['ecard-recipient-mail'] = t('The e-mail address of the recipient.');
+  }
+
+  return $tokens;
+}
+
+/**
+ * Implementation of hook_token_values().
+ */
+function ecard_token_values($type, $object = NULL) {
+  if (in_array($type, array('ecard-mail', 'ecard-notify', 'ecard-copy'))) {
+    $object = (object) $object; // Just to be sure.
+    $values['ecard-sender-name'] = filter_xss($object->sender_name, array());
+    $values['ecard-sender-mail'] = check_plain($object->sender_email);
+    $values['ecard-recipient-mail'] = check_plain($object->recipient_mail);
+    $values['ecard-card-url'] = check_plain($object->card_url);
+    return $values;
+  }
+}
+
+
+/**
  * Implementation hook_mail().
  */
 function ecard_mail($key, &$message, $params) {
   global $base_url;
   switch ($key) {
     case 'ecard-mail':
-      $variables = array(
-          '%site' => variable_get('site_name', 'drupal'),
-          '%site_url' => $base_url,
-          '%site_mail' => variable_get('site_mail', ini_get('sendmail_from')),
-          '%card_url' => $params['card'],
-          '%sender' => $params['sender'],
-          '%sender_email' => $params['sendermail'],
-          '%recipient' => $params['recipient'],
-      );
-      $body = strtr(variable_get('ecard_letter', _ecard_letter()), $variables);
-      $subject = strtr(variable_get('ecard_subject', 'An E-card from %sender'), $variables);
+      $body = token_replace(variable_get('ecard_letter', _ecard_letter()), 'ecard-mail', (object) $params);
+      $subject = token_replace(variable_get('ecard_subject', 'An E-card from [ecard-sender-mail]'), 'ecard-mail', (object) $params);
       $message['subject'] = $subject;
       $message['body'] = $body;
       break;
 
     case 'ecard-copy':
-      $variables = array(
-          '%site' => variable_get('site_name', 'drupal'),
-          '%site_url' => $base_url,
-          '%site_mail' => variable_get('site_mail', ini_get('sendmail_from')),
-          '%card_url' => $params['card_copy'],
-      );
-      $body = strtr(variable_get('ecard_copy', _ecard_copy()), $variables);
-      $subject = strtr(variable_get('ecard_copy_subject', 'Copy of your E-card'), $variables);
+      $body = token_replace(variable_get('ecard_copy', _ecard_copy()), 'ecard-copy', (object) $params);
+      $subject = token_replace(variable_get('ecard_copy_subject', 'Copy of your E-card'), 'ecard-copy', (object) $params);
       $message['subject'] = $subject;
       $message['body'] = $body;
       break;
 
     case 'ecard-notify':
-      $variables = array(
-          '%site' => variable_get('site_name', 'drupal'),
-          '%site_url' => $base_url,
-          '%site_mail' => variable_get('site_mail', ini_get('sendmail_from')),
-          '%card_url' => $params['card_url'],
-          '%sender' => $params['sender'],
-          '%recipient' => $params['recipient'],
-          '%sender_email' => $params['sender_email'],
-      );
-      $body = strtr(variable_get('ecard_notify', _ecard_notify()), $variables);
-      $subject = strtr(variable_get('ecard_notify_subject', 'Your card has been picked up by %recipient'), $variables);
+      $body = token_replace(variable_get('ecard_notify', _ecard_notify()), 'ecard-notify', (object) $params);
+      $subject = token_replace(variable_get('ecard_notify_subject', 'Your card has been picked up by [ecard-recipient-mail]'), 'ecard-notify', (object) $params);
       $message['subject'] = $subject;
       $message['body'] = $body;
       break;
