CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • CiviMail using Joomla Data in Tokens
Pages: [1]

Author Topic: CiviMail using Joomla Data in Tokens  (Read 1001 times)

theitd

  • I’m new here
  • *
  • Posts: 22
  • Karma: 1
    • the ITD
  • CiviCRM version: 3.4.7
  • CMS version: 1.15.26
  • MySQL version: 5.1.66
  • PHP version: 5.3
CiviMail using Joomla Data in Tokens
May 05, 2011, 07:46:48 pm
Here's a workaround which allows you to include Joomla data to be used as custom tokens in CiviMail.

The problem I was having involved encouraging donors to log on before renewing their memberships - and without them having to know their usernames and/or passwords. The process of donating had to be made as simple as possible.

The solution was to use a View in MySQL in the place of a custom_data table, and then use the {contact.custom_XX} tokens in CiviMail message templates. The steps were as follows:

  •   Install and test the Joomla AutoLogin extension from here
  •   From the CiviCRM menu, create a Custom Data set (for example, called 'DONOTEDIT') with 2 fields (user & passw).
  •   Make a note of the field IDs, as described here
  •   In MySQL, DROP the table 'civicrm_value_CUSTOM-DATA-NAME_X'
  •   For the autologin example, I used the following query to create a VIEW in MySQL:
Code: [Select]
SELECT civ_uf_match.id AS id,
civ_uf_match.contact_id AS entity_id,
jou.username AS user_XX,
jou.password AS passw_YY
FROM jos_users jou
JOIN civicrm_uf_match civ_uf_match
ON jou.id = civ_uf_match.uf_id;
  •   It's now possible to include a link in a bulk email made up of custom tokens which contain data taken from a Joomla (user) table:

    http://www.example.org/index.php?user={contact.custom_XX}&passw={contact.custom_YY}


There may well be a simpler solution, in which case I'm all ears. But the documentation on customising tokens/hooks seems to be Drupal specific.

It may go some of the way, though, to answering these empty threads:
http://forum.civicrm.org/index.php/topic,18196.msg75530.html#msg75530
http://forum.civicrm.org/index.php/topic,14817.msg63237.html#msg63237
Too err is human, to really foul things up needs a computer.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviMail using Joomla Data in Tokens
May 05, 2011, 10:17:41 pm

Note that hooks are not drupal specific. Check:

http://wiki.civicrm.org/confluence/display/CRMDOC40/CiviCRM+hook+specification#CiviCRMhookspecification-Proceduresforimplementinghooks%28forJoomla%29

The hook concept originated from drupal (for us) but we've modified it so joomla folks can also use it!

The way you've gotten around it is qutie creative and cool :)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

theitd

  • I’m new here
  • *
  • Posts: 22
  • Karma: 1
    • the ITD
  • CiviCRM version: 3.4.7
  • CMS version: 1.15.26
  • MySQL version: 5.1.66
  • PHP version: 5.3
Re: CiviMail using Joomla Data in Tokens
May 07, 2011, 01:27:05 am
Hi Lobo,

Thanks for that. I entirely missed it!
I'll have a go at doing it that way instead (!) and let you know.

Cheers,
Ben.
Too err is human, to really foul things up needs a computer.

dwfriederichs

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 1
Re: CiviMail using Joomla Data in Tokens
January 08, 2012, 06:20:38 pm
theitd, I tried what you suggested and can't seem to get it to work.  I posted my questions at http://forum.civicrm.org/index.php/topic,22899.0.html.  If you can help I'd appreciate it greatly.

Thanks!


Dave Friederichs

dwfriederichs

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 1
Re: CiviMail using Joomla Data in Tokens
January 08, 2012, 06:55:03 pm
I figured it out.  My test site was pointing to the production database and thus didn't see the changes.

Thanks!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • CiviMail using Joomla Data in Tokens

This forum was archived on 2017-11-26.