[SOLVED] Formating of Field-output and obtaining a name for

12 years 2 months ago - 12 years 2 months ago #192020 by iamalive
Hi
I'm having a Problem in formating the output of certain fields, which are included in an email sent by CB.

Specifically, the date, and multiple checkboxes.

The date looks like this when in the email

Geburtsdatum 1965-05-13

and what I need is the european format of 13-05-1965. I've selected that in the global settings and it shows that when the fields are filled out in the form, but it doesn't translate like that when I use the field name in the email - here: [cb_geburtsdatum]

The multiple checkboxes have the format of

Auto|*|PC|*|Internet|*|Handy

and I'd like to add more space between the individual items, as my client claims he can hardly separate them.

Can you tell me how to achieve all of the above?

In addition, the email of the addressee is identified using a query field, which works fine. However, I would also like to include the name of the person to whom the email address belongs to, in the email content, but I've no idea how to do that. Presumably with a nother query, but I am an imbecile when it comes to this kind of thing. Can you help me with this too?

Thanks in advance.
Regards
David

Please Log in to join the conversation.

12 years 2 months ago #192043 by krileon

and what I need is the european format of 13-05-1965. I've selected that in the global settings and it shows that when the fields are filled out in the form, but it doesn't translate like that when I use the field name in the email - here: [cb_geburtsdatum]

[FIELDNAME] always outputs raw field value. You'll need to use [cb:userfield field="cb_geburtsdatum" /] for it to be formatted.

and I'd like to add more space between the individual items, as my client claims he can hardly separate them.

It's also being substituted as raw value. Using [cb:userfield field="FIELDNAME" /] will resolve this and display it delimitered as you've configured it to within the fields configuration in CB > Field Management.

In addition, the email of the addressee is identified using a query field, which works fine. However, I would also like to include the name of the person to whom the email address belongs to, in the email content, but I've no idea how to do that. Presumably with a nother query, but I am an imbecile when it comes to this kind of thing. Can you help me with this too?

Query field isn't needed for this. You could use [name] and [email] for example. At any rate if you need it to be done by query field then you'll also need to create a query field to return the name column instead of email column.


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.
The following user(s) said Thank You: iamalive

Please Log in to join the conversation.

12 years 2 months ago #192113 by iamalive
Hi
Thanks for the input - that worked, except for the last bit:

Using the "name" field, provides the name of the person who filled out the form, not of the adressee.

So I copied a query you had provided and adapted it to get the name I need in a new query field. I checked if it worked by having it show up in the profile when registerd - works as expected and provides the full name of that person.

The script is:

SELECT u.`name` FROM `#__users` AS u LEFT JOIN `#__comprofiler` AS ue ON u.`id` = ue.`user_id` WHERE ue.`cb_pin` = '[cb_pin]'



So I added the field in the email - Ansprechpartner: [cb_mypartner] - and all the shows up is the field. That is, [cb_mypartner] and not the name of the person. I also tried : [cb:userfield field="cb_mypartner" /] which just provides an empty field in the email. I've checked that everything is spelt correctly.

I then tried changing the trigger, in case it was a timing issue and used : onAfterUserRegistrationMailsSent,onAfterUsersListFieldsSql
But that made on no difference.

So I'm stuck again. Sorry.

Can you provide light, please?

Regards
David

Please Log in to join the conversation.

12 years 2 months ago - 12 years 2 months ago #192161 by krileon

So I added the field in the email - Ansprechpartner: [cb_mypartner] - and all the shows up is the field. That is, [cb_mypartner] and not the name of the person. I also tried : [cb:userfield field="cb_mypartner" /] which just provides an empty field in the email. I've checked that everything is spelt correctly.

Maybe wrong field name? If not done so please upgrade to CB 1.8 as we've made some further improvements to substitution API that maybe able to help resolve your issue. It could also be a permissions problem; ensure the field is on a public and published tab. Also ensure the field is set to display on profile.


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.
The following user(s) said Thank You: iamalive

Please Log in to join the conversation.

12 years 2 months ago #192163 by iamalive
Hi Kyle

Thanks for the input.

I had the tab set to be seen only by "Registered" users. I changed that to "Public" and now it works! I'm surprised - pleasently.

Thanks a bunch.

Regards
David

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.210 seconds

Facebook Twitter LinkedIn