For instance, if a node has a & in its title, [node:title] will display & instead of & in the mail.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

anrikun created an issue. See original summary.

anrikun’s picture

Status: Active » Closed (works as designed)

But even with a & in product title, stock tests pass though. Problem must be elsewhere.

anrikun’s picture

Status: Closed (works as designed) » Active

Got it. Stock notification tests pass because they are run through TestingMailSystem instead of UbercartMailSystem.
So basically tests are wrong too.

anrikun’s picture

Let's try these:
1. Updated and fixed tests: should fail
2. Full patch: should pass

TR’s picture

Status: Needs review » Active

The stock e-mails, and everything else sent with UbercartMailSystem, are assumed to be HTML content. So & *should* be replaced by & (single encoding). Are you saying the text actually contains & (double encoding)?

anrikun’s picture

Status: Active » Needs review

Yes, I mean double encoding.
As HTML is expected, tokens should not be sanitized.

anrikun’s picture

@TR
Here is my stock notifications config (sorry it's in French):
Subject: Seuil de stock atteint pour [node:title] ([uc_stock:model])
Body: Le niveau du stock de l’article [node:title] ([uc_stock:model]) a atteint [uc_stock:level].

And the mail I've received for a product called "Jaked R&R Fenice":

Seuil de stock atteint pour Jaked R&R Fenice (jake123)

Le niveau du stock de l’article Jaked R&R Fenice (jake123) a atteint 0.