What I have tried :
1)
I already have a Campaign Member custom field (Using Formula Text) showing QR code on the detail page tied to their respective Campaign Member Id
E.g. IMAGE('http://api.qrserver.com/v1/create-qr-code/?size=200x200&qzone=1&data=<Force.com site> + Id, 'QR Code')
.
Then from there I will call using merge field on the HTML Email Template like {!CampaignMember.QrCode__c}. When testing it by getting it to send to my personal email inbox, by right it should have shown the QR Code image generated but instead just shows the string "QR Code
"
2) I have seen many answers online telling me I should upload it to Documents. However, if I have >100 Campaign Members, I would then need to upload >100 Qr code generated images with unique IDs on Documents? (So definitely can't go with this approach)
3) Making the html tag dynamic in HTML Email Template itself like
<img src="http://api.qrserver.com/v1/create-qr-code/?size=200x200&qzone=1&data=http%3A%2F%2Fvictorng-dev-ed--c.ap2.visual.force.com%2Fapex%2FCampaignMemberQRCodeAttendance_Std%3Fid%3D"
+ {!CampaignMember.QRCode__c}>
But when scanning the QR code it will open the url https://victorng-developer-edition.ap2.force.com/TestVF?id=
without the Campaign Member Id. Is there a way to concat the id with the url?
Best Answer
If all you see in your email client is "QR Code" (the image's
alt
attribute) it sounds like the email client is configured to not download images from external websites. Check if you have a warning similar to this:(Image copied from https://www.wintips.org/wp-content/uploads/2017/06/image-8.png)
Alternatively you can also try to inspect the raw HTML of the message (in Gmail web client it's "show original" option in the dropdown menu) to verify the link is constructed OK, it's "just" that protection kicks in.
Not sure what you can do about it to be honest. Quite a lot of spammers / scammers / semi-legitimate marketing people try to get their images to display so they can "phone home" and report that this particular email was opened. It's called "tracking pixel" or "web beacon" and even SF uses it to track the Campaign Members.
Couple ideas:
As for your #3, the Campaign Member Id missing - either you screwed up while anonymising the code to post it here or you're using the wrong merge field. You want it to be
right? not the
QRCode__c
. Again - your best choice would be to inspect the raw generated HTML of the email and experiment a bit. (And maybe use someURLFOR
/URLENCODE
to do the escaping automatically)