Closed (duplicate)
Project:
Mailout
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 Nov 2008 at 20:31 UTC
Updated:
29 Jan 2009 at 05:35 UTC
The code below adds variables replacement feature to emails sent using Mailout. The code comes from the simplenews module. The variable %name (subscriber's name) was added.
// Replace variables (code from simplenews_replace_vars)
global $base_url;
$variables = array(
'%site' => variable_get('site_name', 'drupal'),
'%uri' => $base_url,
'%uri_brief' => drupal_substr($base_url, drupal_strlen('http://')),
'%name' => $data['name'],
'%email' => $data['email_to'],
'%date' => format_date(time()),
'%login_uri' => url('user/login', NULL, NULL, TRUE),
);
$final_email_body = strtr($final_email_body, $variables);
$final_plain = strtr($final_plain, $variables);
This code is to be inserted in mailout_send.inc line 597 right after:
$final_plain = $data['email_plain'];
Comments
Comment #1
AlenaSystems commentedComment #2
simeThanks Alena!
I've added a link back to these suggestions from another issue:
http://drupal.org/node/262836