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) »
  • Views into Civimail Tokens
Pages: [1]

Author Topic: Views into Civimail Tokens  (Read 1141 times)

irvken

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 1
Views into Civimail Tokens
March 12, 2014, 03:58:39 am
Eileen McNaughton developed a module hosted on GitHub at https://github.com/eileenmcnaughton/civicrm_views_token

This allows users to create a view in Drupal and have it available as a token in CiviMail to embed the view in mailings

We installed that module and built a view of current content posted on our website and successfully embedded it into a mailing template, so that every time that template is used, the token area is automatically populated with latest content from the website.

So far so good.

What we need is the module to be adapted so that more than one drupal view and one token is supported. Any pointers to how to go about doing this would be great, there is also cash available to pay someone to develop this functionality if necessary.

Cheers

Sean

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Views into Civimail Tokens
March 12, 2014, 01:32:09 pm
Hi Sean - I have notified Eileen about the above request assuming you haven't and will get back to you via PM with an estimate.
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

sonicthoughts

  • Ask me questions
  • ****
  • Posts: 498
  • Karma: 10
Re: Views into Civimail Tokens
March 13, 2014, 08:00:11 am
This is yet another fantastic piece of code from Eileen!
Since Drupal is a content management system, a lot of time is spent getting drupal content into civicrm.  I know there was discussion about using drupal tokens and nodes as civicrm tokens (which would be fantastic.)  Perhaps the great work Eileen is doing on drupal entities could be used here instead.  That would allow a single drupal module to address all these needs.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Views into Civimail Tokens
March 13, 2014, 02:23:22 pm
Sean,

Check this line  - the variable is converted into an array - I don't know what setting the variable to an array using drush would look like but it is presumable not too hard to figure out

https://github.com/eileenmcnaughton/civicrm_views_token/blob/master/civicrm_views_token.module#L72

Have a look at this too

http://fuzion.co.nz/blogs/styling-mails-civimails-civicrm

Your take-away from that should be that your view needs a table layout not a div layout for outlook
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Views into Civimail Tokens
March 13, 2014, 02:28:34 pm
NB - sonicthoughts - this isn't really an extension of the entity concept as the civicrm token is a very civi concept.

We have had some conversations lately about automatically mailing out drupal content items as CiviMail (think press releases) & I'm hoping to see a blog posted fleshing that out a bit
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

sonicthoughts

  • Ask me questions
  • ****
  • Posts: 498
  • Karma: 10
Re: Views into Civimail Tokens
March 14, 2014, 12:33:09 pm
The CiviCRM Cookbook book describes a very interesting approach using drupal blocks or nodes and inserting into a template.  A token would even be better IMO.  Often a mailing is just reproducing a bunch of content already present in the CMS.

irvken

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 1
Re: Views into Civimail Tokens
September 01, 2014, 05:27:07 am
Quote from: Eileen on March 13, 2014, 02:23:22 pm
Sean,

Check this line  - the variable is converted into an array - I don't know what setting the variable to an array using drush would look like but it is presumable not too hard to figure out

https://github.com/eileenmcnaughton/civicrm_views_token/blob/master/civicrm_views_token.module#L72



Have a look at this too

http://fuzion.co.nz/blogs/styling-mails-civimails-civicrm

Your take-away from that should be that your view needs a table layout not a div layout for outlook

Hi Eileen, Sorry for the delay in replying!!  Was talking to a company about this but that seems to have petered out.  I assumed the Array was to hold the different elements of the view, not multiple views. I'm not a PHP expert (or even a novice), but I thought I could just clone the module and rename all the variables to get a second view into an embeddable token, then a third, then a fourth etc. but have been warned off this by my MYSQL/PHP acquaintances as it would mess up the database? How then to get multiple views into multiple tokens with one module.? We are willing to pay to get this work done!

Cheers

Sean

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Views into Civimail Tokens
September 01, 2014, 02:37:40 pm
So this command

drush vset civicrm_views_token_views nodequeue_1

Sets the variable civicrm_views_token_views to be equal to {'nodequeue_1'}

so the drupal variable is holding an array of view names.

Presumably you can set an array like

drush vset civicrm_views_token_views {'nodequeue_1', 'email'}

-or similar
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

irvken

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 1
Re: Views into Civimail Tokens
October 02, 2014, 03:08:09 am
Thanks Eileen,

That worked quite well and we have multiple views available to include in bulk emails now.

However we have an "issue" with the URLS generated through the module, which may not be down to the module but to our own configuration, but I don't know why it's happening.

When we test a bulk email the links work perfectly as in (1) below

(1)http://www.voscur.org/new-job-entry-page/1-oct-2014-1016/bristol-drugs-project-shared-care-worker

But when the mail is actually scheduled and sent any links generated from the view look like this and don't then work

(2)http://www.voscur.org/sites/all/modules/civicrm/bin/sites/all/modules/civicrm/bin/sites/all/modules/civicrm/bin/new-job-entry-page/1-oct-2014-1016/bristol-drugs-project-shared-care-worker

If anyone has any insight that might be helpful it would be appreciated

Sean

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Views into Civimail Tokens
October 02, 2014, 12:52:08 pm
hmm - must be a relative path in there being picked up ... presumably the view has a relative link & it is being rendered relative to where the scrips is being sent from.

Does sending view drush make any difference? presumably the directory you are in affects it. It's so long since I looked at that code I'm not sure what the fix within the code would be
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Views into Civimail Tokens

This forum was archived on 2017-11-26.