CRM-13319 Social media buttons in event confirmation email have bad HTML

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.3.5
    • Fix Version/s: 4.5
    • Component/s: CiviEvent

      Description

      In event confirmation emails, buttons for Tweet and Facebook Like do not function in some email clients, notably Outlook 2003. The reason is that the links are of the form: "href=//twitter.com" rather than "href="http://twitter.com".

      After applying the attached patch to templates/CRM/common/SocialNetwork.tpl the two links worked as expected in subsequent emails.

      In addition to the two links in the "

      {if $emailMode eq true}

      " block, the patch also makes similar changes in 3 additional links in the following "

      {else}

      " which affects the social media links on the event web page. When tested with Firefox, these links worked both before and after the patch.

        Attachments

        1. SocialNetwork.tpl_1.diff
          1.0 kB
          Bob Silvern
        2. SocialNetwork.tpl.diff
          2 kB
          Bob Silvern

          Activity

          [CRM-13319] Social media buttons in event confirmation email have bad HTML
          Donald A. Lobo added a comment -

          U'll need to rework this patch a wee bit and ensure that it also works when admins are using https. We skip the protocol (http or https) since it inherits it from the page)

          I would check if this works with more recent versions of outlook and with other email clients too

          thx

          lobo

          Bob Silvern added a comment - - edited

          I do not have admin access to a Civi site with SSL capability, but since you explained that for web pages the protocol is inherited, and since I did not observe any problems due to the missing protocols in web pages using FireFox 23, IE8 or Chrome 29, I reverted the 3 URL instances related to web page display to the original state.

          The attached patch SocialNetwork.tpl_1.diff therefore adds the “http:” protocol only to the 2 instances of social media buttons that are displayed in the event confirmation email.

          I tested it with the following results:

          • Outlook 2003: original fails, patched OK
          • Outlook 2010: original OK, patched OK
          • Thunderbird 17.0.8: original fails, patched OK
          • Gmail / Firefox: original OK, patched OK
          Brian Shaughnessy added a comment -

          I just ran into this as well, and think it should be pulled back down to 4.5 as it renders the social network links useless.

          Why don't we just use http for the email links and always use https for the web links? Even if the page is rendered in http, there's no harm in pulling the network links in via https – that way we account for both scenarios.

          David Greenberg added a comment -

          Brian - can you submit a PR against master using the above approach?

            People

            • Assignee:
              David Greenberg
              Reporter:
              Bob Silvern

              Dates

              • Created:
                Updated:
                Resolved: