[#5358] Adding uploaded file registration field into email

8 years 10 months ago #266499 by cagoffice
I am confused. So I don't use quotes. Then wouldn't my code be:

[cb:userdata field=\cb_fileupload_1\ /]

Please Log in to join the conversation.

8 years 10 months ago #266500 by krileon
You have to use quotes. That's how the substitution is formatted.

Valid:
'KEY' => 'This is my language string'

Invalid:
'KEY' => 'This's my language string'

The above is invalid because the string is surrounded by single quote, but there's an unescaped single quote in it which causes it to break out early. It would be escaped as follows.

'KEY' => 'This\'s my language string'

This is just basics of PHP though and not specific to our usage. I highly recommend using an IDE and becoming more familiar with PHP. See the below for some PHP tutorials.

www.w3schools.com/php/default.asp

There's nothing more I can suggest without seeing your full language string. In your case I'm guessing you're hitting something like the following.

Invalid:
"KEY" => "My string [cb:userdata field="cb_fileupload_1" /]"

Valid:
"KEY" => "My string [cb:userdata field=\"cb_fileupload_1\" /]"


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

8 years 10 months ago #266503 by cagoffice
Sorry I should have given you the full string:

'UE_REG_ADMIN_PA_MSG' => 'A new Membership Application has been received by the CAG and requires approval. Please log in to [SITEURL] to approve or reject.\n\nMember Details\n\nName - [NAME]\nE-mail - [EMAILADDRESS]\nProfession - [cb_profession]\nInstitution - [cb_institution]\nFile Upload - [cb_fileupload_1]\nFile Upload - [cb:userdata field="cb_fileupload_1"]',

Please Log in to join the conversation.

8 years 10 months ago #266506 by cagoffice
With the string above, this is how is appears in an email (see attached screenshot).

I would like a link that the moderator can click on.
Attachments:

Please Log in to join the conversation.

8 years 10 months ago #266507 by krileon
The first raw substitution is working fine, but its HTML looks escaped. The second one isn't working because the substitution isn't closed. It needs to be as follows.

[cb:userdata field="cb_fileupload_1" /]

You have the following.

[cb:userdata field="cb_fileupload_1"]

The below may work too.

[cb:userfield field="cb_fileupload_1" output="csv" /]


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

8 years 10 months ago #266510 by cagoffice
Ok the second one worked but it looks a little messy (see attached).
Attachments:

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.326 seconds

Facebook Twitter LinkedIn