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) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions »
  • Usability Improvements (Moderator: Dave Greenberg) »
  • Allow scripting (such as Facebook "like") in CiviMail templates/headers/footers
Pages: [1]

Author Topic: Allow scripting (such as Facebook "like") in CiviMail templates/headers/footers  (Read 1216 times)

m.e.

  • I post frequently
  • ***
  • Posts: 157
  • Karma: 5
  • CiviCRM version: 4.0.9
  • CMS version: Drupal 7.9
Allow scripting (such as Facebook "like") in CiviMail templates/headers/footers
December 06, 2011, 08:28:16 am
Currently (4.0.9) an error message appears when a script is inserted into an email, probably as a security measure. But we'd like to embed, as just one example, a Facebook Like button. It would be great to have a permissions setting that would make this possible.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Allow scripting (such as Facebook "like") in CiviMail templates/headers/footers
December 06, 2011, 01:33:39 pm
Social network links (FB like, Tweet, Google +) have been added as options for Event and Online Contribution pages in the 4.1 release (now in Alpha): http://issues.civicrm.org/jira/browse/CRM-8737

My understanding is that most (all?) email clients won't allow email content containing scripts. However, the 4.1 code uses images and links only when used as part of email receipts / confirmations. Code snippet here. The $url variable is the URL of the event of contribution page being promoted:

Code: [Select]
            {*use images for email*}
            <a href="http://twitter.com/share?url={$url}&amp;text={$title}" id="crm_tweet">
                <img title="Twitter Tweet Button" src="{$config->userFrameworkResourceURL}/i/tweet.png" width="55px" height="20px"  alt="Tweet Button">
            </a>
            <a href="http://www.facebook.com/plugins/like.php?href={$url}" target="_blank">
                <img title="Facebook Like Button" src="{$config->userFrameworkResourceURL}/i/fblike.png" alt="Facbook Button" />
            </a>

I think you can add the same to your CiviMail mailing footer etc. (altho haven't tried it). Do report back here on your results.
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions »
  • Usability Improvements (Moderator: Dave Greenberg) »
  • Allow scripting (such as Facebook "like") in CiviMail templates/headers/footers

This forum was archived on 2017-11-26.