Hello,

I am using bacode 8.1.8 version module. I have created text plain cck field and barcode set in manage display, so barcode is displaying in node display page. I want to send this barcode in token but it's not rendering barcode, it's displaying like in email:

style="width:100.000000px;height:100.000000px;position:relative;font-size:0;border:none;padding:0;margin:0;background-color:rgba(100%,100%,100%,1);">

What am I missing something? Or something wrong with this module?
Please help.

CommentFileSizeAuthor
#6 barcode.PNG26.05 KBrituraj.gupta
#4 Capture.PNG33.16 KBrituraj.gupta

Comments

rituraj.gupta created an issue. See original summary.

rituraj.gupta’s picture

Assigned: Unassigned » rituraj.gupta
rituraj.gupta’s picture

Assigned: rituraj.gupta » Unassigned
rituraj.gupta’s picture

StatusFileSize
new33.16 KB
sanduhrs’s picture

Status: Active » Closed (works as designed)

Apparently 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.

rituraj.gupta’s picture

StatusFileSize
new26.05 KB

Hi @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

weizrd’s picture

Version: 8.x-1.8 » 8.x-1.x-dev
Priority: Major » Normal
Status: Closed (works as designed) » Active

I'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

sanduhrs’s picture

Status: Active » Closed (outdated)