I'm using simplenews on a multilingual site, but send newsletters only for all languages together. Everyone gets every paragraph in three languages. Works fine, don't want to change that.

But in the footer I need three different unsubscribe-links. One for each language. At present it looks like this:

<p class="abmeldelink">Wenn Du den Newsletter nicht mehr erhalten m&ouml;chtest, <a href="!confirm_unsubscribe_url">klicke hier</a> und melde dich ab.<br />
<span class='blau'>Pour vous désabonner, <a href="!confirm_unsubscribe_url">cliquez ici</a>.</span><br />
<span class='rot'>If you don't want to receive this newsletter in future, <a href="!confirm_unsubscribe_url">click here</a> and unsubscribe.</span>
</p>

Which results in three lines, every line has one link, but they are all linking to the german unsubscribe-page.

Any idea how I can change that? Is there a possibility to create the link with a function?

The URL is http://example.de/de/newsletter/confirm/remove/37675bb48b7t17.

The problem is the number at the end. Is it called hash? If I know how to print that with php I could build three different URLs without the token. But my skills in php are limited...

Comments

simon georges’s picture

In the simplenews_mail_token() function, you'll find quite everything you need, I think, so you just can add :

$vars['!url_de'] = url('newsletter/confirm/remove/'. $hash, array('absolute' => TRUE, 'language' => 'de'));
$vars['!url_fr'] = url('newsletter/confirm/remove/'. $hash, array('absolute' => TRUE, 'language' => 'fr'));
$vars['!url_en'] = url('newsletter/confirm/remove/'. $hash, array('absolute' => TRUE, 'language' => 'en'));

and reuse these tokens in the simplenews-footer.tpl.php.

I hope you'll succeed in having your 3 urls.

simon georges’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.