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) »
  • Anchor Text in Mails
Pages: [1]

Author Topic: Anchor Text in Mails  (Read 1015 times)

Will Roy

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 3.3.1
  • CMS version: Unknown
  • MySQL version: Unknown
  • PHP version: Unknown
Anchor Text in Mails
October 12, 2011, 02:45:20 pm
Hi folks.

Is there any way to change the colour of anchor text in mails sent by CiviMail?

TwoMice

  • I post frequently
  • ***
  • Posts: 214
  • Karma: 16
    • Emphanos
  • CiviCRM version: Always current stable version
  • CMS version: Drupal 7
Re: Anchor Text in Mails
October 12, 2011, 04:04:01 pm
Hi Will,

Anchor text color can be affected with CSS in an HTML email.  If you're hand-coding the links, you can use inline styles:
Code: [Select]
<a href="http://example.com" style="color: green">Example link</a>
This won't work for links generated with CiviMail tokens, since you're not writing those links by hand. In that case, CSS stylesheets in the HTML header can do the trick.  When I define the mailing content, I select the "Upload Content" option, and then upload HTML content with the stylesheet in the <head>.  Example:
Code: [Select]
<html>
<head>
  <style type="text/css">
    a {
      color: green;
    }
  </style>
</head>
<body>
<p>body here.</p>
<p><a href="http://example.com">Example link</a></p>
<p>Forward link: {action.forward}</p>
</body>
</html>

Caveats:
  • I'm not sure if you can add stylesheets to the HTML without uploading, for example while writing the HTML content in the WYSIWYG editor.  This thread seems to indicate it won't work: http://forum.civicrm.org/index.php?topic=10309.0
  • HTML/CSS displays can vary widely depending on the recipient's email reader. I would expect something this simple to be handled pretty well, but you'll want to test first if you're really concerned.

Best luck,
Allen
Please consider contributing to help improve CiviCRM with the Make it Happen! initiative.

Will Roy

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 3.3.1
  • CMS version: Unknown
  • MySQL version: Unknown
  • PHP version: Unknown
Re: Anchor Text in Mails
October 12, 2011, 06:40:41 pm
Just what I needed.

Thanks for replying so quick!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Anchor Text in Mails

This forum was archived on 2017-11-26.