9 years ago
6
Topic

Hi !

I've found the video tutorial for triggering emails with site form, but it's not really clear on how to call some specific fields like weblink, encoded in JSON. When I use the hashtags, I get the JSON encoded field, like that : {"link":"http:\/\/example.com"}, and I don't know which PHP syntax I can use instead of hashtags.

J'ai visionné le tuto pour l'envoi d'email à partir du formulaire front-end, mais ça ne donne pas d'exemple pour l'intégration des champs spéciaux comme les liens, qui sont encodés en JSON. Avec les ##, ça donne la version encodé en JSON, et je ne vois pas quelle syntaxe PHP utiliser à la place.

Get a Book for SEBLOD
4229 Posts
Kadministrator
9 years ago
1
Level 1

Hi,

fFor link field you need to use #link# not #value#

9 years ago
0
Level 2

Thank you Octopoos for the quick response, but I still didn't figure out.

In fact I have 2 weblink fields (website and Facebook page links), so how I call both of them instead of #website# and #fb_page# ?

4229 Posts
Kadministrator
9 years ago
3
Level 1

Then you need to use second notation - use

$cck->getAttr('fieldname'); - replace attr with Value, Typo or in the case of link field with Link

9 years ago
2
Level 2

Thank you Octopoos. I tried $cck->getLink('website'); but nothing appears in the email. Maybe a special treatment for JSON encoded fields ?

4229 Posts
Kadministrator
9 years ago
1
Level 3

$cck->getLink('website'); should work if website field is type link. But only in message, this won't work in subject.

9 years ago
0
Level 4

Unfortunately, it's not.

When I use $cck->getValue('website'); I have something like : {"link":"http:\/\/www.example.com"} in the email. But with $cck->getLink('website'); I have only a blank space...

Get a Book for SEBLOD