[SOLVED] Show email: user decision??

13 years 3 months ago #147824 by erpicio
[SOLVED] Show email: user decision?? was created by erpicio
Hello,
is it possible to allow users to decide if their e-mail has to be shown on their profile or not? :)
If not, the link to the email composition module should be shown.

Thanks :)

Post edited by: erpicio, at: 2010/12/08 03:02

Please Log in to join the conversation.

13 years 3 months ago #147905 by krileon
Replied by krileon on topic Re:Show email: user decision??
You could add a new field like a checkbox field that says show email: yes or no. You'd then use a delimiter field to format the display of the Email using substitutions. Example of the substitution as follows.

[code:1]
[cb:if cb_showemail="1"][cb:userdata field="email" /][/cb:if]
[cb:if cb_showemail="0"]<a href="index.php?option=com_comprofiler&task=emailUser&uid=[user_id]">Send Email</a>[/cb:if]
[/code:1]

You could also use documentation subscriber CB Privacy to allow users privacy controls over the email field.


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.

13 years 3 months ago #147958 by erpicio
Replied by erpicio on topic Re:Show email: user decision??
txs alot! i had to mess things up a bit before i figured out how to configure everything in the right way, but now it seems to work :)

your code applied to my variables and translated in italian is:
[code:1][cb:if cb_mostraemailnelprofilo="Si"][cb:userdata field="email" /][/cb:if]
[cb:if cb_mostraemailnelprofilo="No"]<a href="index.php?option=com_comprofiler&amp;task=emailUser&amp;uid=[user_id]">Invia E-mail</a>[/cb:if]​[/code:1]

last question: how can i make this
[code:1][cb:if cb_mostraemailnelprofilo="Si"][cb:userdata field="email" /][/cb:if][/code:1]
become a mailto link?

i can't figure out the way to put the variable into the href mailto code. :(

Please Log in to join the conversation.

13 years 3 months ago #148019 by krileon
Replied by krileon on topic Re:Show email: user decision??
You could try the following to make a mailto link. There's not guarantee this will work though, sorry.

[code:1]
[cb:if cb_mostraemailnelprofilo="Si"]<a href="mailto:[email]">[email]</a>[/cb:if]
[/code: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.

13 years 3 months ago #148066 by erpicio
Replied by erpicio on topic Re:Show email: user decision??
Worked perfectly! :woohoo:
I think we (you) managed to solve and document a common issue that may be useful to many, don't you think?
I will recap for the record.

1) I created 3 fields:
- A primaryemailaddress field named email (where users insert their email; this field is not shown on their profile, but only in the user registration form)

- A radio field named cb_showemail (where the users decide whether to show their email with Yes or No; this field is not shown on their profile, but only in the user registration form)

- A delimiter field named as you like (this is the field that must be shown on users' profile)

2) In the wysiwyg text area inside the delimiter settings, i activated the code visualization and wrote the following code:
[code:1][cb:if cb_showemail="Yes"]<a href="mailto:[email]">[email]</a>[/cb:if]

[cb:if cb_showemail="No"]<a href="index.php?option=com_comprofiler&amp;task=emailUser&amp;uid=[user_id]">Send E-mail</a>[/cb:if][/code:1]

3) In CB General Config -> General tab, from the Email management dropdown, you have to set "Show only email" in order to make all the stuff working.

All the above will show the email address+mailto link for the users that clicked on Yes from the radio button in registration form, and will show a "Send E-mail" link to CB e-mail composition form for those who selected No from the radio button.

Btw if you wanna check the website were i applied this code the address is: www.archivillage.it/

(Google translated website: bit.ly/hmFnu4 )

tyvm for this and for developing CB :)

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.196 seconds

Facebook Twitter LinkedIn