Closed (outdated)
Project:
Barcodes
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
13 Dec 2018 at 07:20 UTC
Updated:
1 Jun 2020 at 09:03 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
rituraj.gupta commentedComment #3
rituraj.gupta commentedComment #4
rituraj.gupta commentedComment #5
sanduhrsApparently you are adding html the barcode svg to a plain text email - this won't work.
Please first make your emails html, then it should work as you expect.
Comment #6
rituraj.gupta commentedHi @sanduhrs,
I have set the header in hook_mail, hook_mail_alter after that emails are being send in HTML format but I am trying to convert the svg into html and that is not working.
in Hook_mail, hook_mail_alter:
$message['headers']['Content-Type'] = 'text/html; charset=UTF-8; format=flowed; delsp=yes';
$message['body'] = array_map(function ($text) {
return Markup::create($text);
}, $text);
Please check screenshot(barcode.PNG). In this I have set the barcode in custom token and after sending email, contents are displaying as in capture.PNG.
Please let me know if any other information required.
Regards,
Ritu Raj
Comment #7
weizrd commentedI'm trying as well to send the barcode through a html email but could not figure it out. Text is received formatted but the barcode field just shows the value, not the svg. It does get get correctly generated on the node view.
Could you share please a bit more of your code? is that a new module? or is there another method? The easiest would be of course an argument to the token of the field (like it was offered for the twig).
Thank you
Comment #8
sanduhrs