Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Feb 2008
    Location
    Ann Arbor, MI
    Posts
    26
    Plugin Contributions
    0

    Default Need a bit of PHP help (probably very easy!)

    I am customizing some of the text in the welcome email (includes/languages/english/CUSTOM/create_account.php)

    It is 99% doing what I want, except for the fact that when the email comes through to the user, the words "sign up!" do not appear as a clickable link to www.example.com.

    The other links in the email DO come through as clickable links, so I'm trying to figure out what I did wrong with my link that it's not working. Like I said, probably a super easy question for someone who's a pro with PHP!

    Here is the relevant line of code (I can give the whole thing if necessary, but I'm pretty sure my mistake is in this line, I think?)

    Code:
    define('EMAIL_TEXT', 'You are now registered with the store. Along with purchasing products and services you can also:' . "\n\n<ul>" . '<li>-View your Order History.' . "\n\n" . '<li>-Save items in your Shopping Cart until you remove them or check out.' . "\n\n" . '<li>-Keep more than one address on file in case you want to send a gift to someone.' . "\n\n" . '<li>-Review products to help others make the best decisions about products and services' . "\n\n</ul>" . 'Also, if you are not already on my email list for weekly tips, recipes, support and inspiration, please <a href="http://www.example.com">sign up!</a>' . "\n\n");
    Any help greatly appreciated. I've been staring at it for two hours and I'm growing weary of having to delete/set up my "new user" every single time I test it!

  2. #2
    Join Date
    Dec 2011
    Location
    Wisconsin, USA
    Posts
    674
    Plugin Contributions
    21

    Default Re: Need a bit of PHP help (probably very easy!)

    is it possible that it's the email program that is making them clickable?

  3. #3
    Join Date
    Feb 2008
    Location
    Ann Arbor, MI
    Posts
    26
    Plugin Contributions
    0

    Default Re: Need a bit of PHP help (probably very easy!)

    Well, yes, the email program should take all the links and make them clickable (blue in my email program).

    The other links in the welcome email message ("please email us at [email protected]", the link to the store under the signature, and the link to the store email in the 2nd to last para all DO come through as clickable. It's only the one I created that doesn't, so that's why I'm assuming I have some incorrect syntax.

    I guess I should have included a bit more of the code so you can see the links that ARE working, in addition to the one I create that does not.

    Code:
    define('EMAIL_TEXT', 'You are now registered with the store. Along with purchasing products and services you can also:' . "\n\n<ul>" . '<li>-View your Order History.' . "\n\n" . '<li>-Save items in your Shopping Cart until you remove them or check out.' . "\n\n" . '<li>-Keep more than one address on file in case you want to send a gift to someone.' . "\n\n" . '<li>-Review products to help others make the best decisions about products and services' . "\n\n</ul>" . 'Also, if you are not already on my email list for weekly tips, recipes, support and inspiration, please <a href="http://www.example.com">sign up!</a>' . "\n\n");
    define('EMAIL_CONTACT', 'For any support with the store, please email us at: <a href="mailto:' . STORE_OWNER_EMAIL_ADDRESS . '">'. STORE_OWNER_EMAIL_ADDRESS ." </a>\n\n");
    define('EMAIL_GV_CLOSURE', "\n" . 'Warmly,' . "\n\n" . STORE_OWNER . "\nFamily Wellness Coach\n\n". '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'.HTTP_SERVER . DIR_WS_CATALOG ."</a>\n\n");
    
    // email disclaimer - this disclaimer is separate from all other email disclaimers
    define('EMAIL_DISCLAIMER_NEW_CUSTOMER', 'This email address was given to us by you or by one of our customers. If you did not signup for an account, or feel that you have received this email in error, please send an email to %s ');

  4. #4
    Join Date
    Dec 2011
    Location
    Wisconsin, USA
    Posts
    674
    Plugin Contributions
    21

    Default Re: Need a bit of PHP help (probably very easy!)

    Have you tried replacing?
    <a href="http://www.example.com">
    with:
    <a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">

  5. #5
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Need a bit of PHP help (probably very easy!)

    Quote Originally Posted by brightgirl View Post
    It is 99% doing what I want, except for the fact that when the email comes through to the user, the words "sign up!" do not appear as a clickable link
    Any help greatly appreciated
    Try escaping the quotes:

    Eg: Change
    Code:
    <a href="http://www.example.com">sign up!</a>'
    to
    Code:
    <a href=\"http://www.example.com\">sign up!</a>'
    Cheers
    RodG

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,871
    Plugin Contributions
    96

    Default Re: Need a bit of PHP help (probably very easy!)

    It might be the unordered list that's throwing the link off; you need to close the <li> tags:
    Code:
    define('EMAIL_TEXT', 'You are now registered with the store. Along with purchasing products and services you can also:' . "\n\n<ul>" . '<li>-View your Order History.</li>' . "\n\n" . '<li>-Save items in your Shopping Cart until you remove them or check out.</li>' . "\n\n" . '<li>-Keep more than one address on file in case you want to send a gift to someone.</li>' . "\n\n" . '<li>-Review products to help others make the best decisions about products and services</li>' . "\n\n</ul>" . 'Also, if you are not already on my email list for weekly tips, recipes, support and inspiration, please <a href="http://www.example.com">sign up!</a>' . "\n\n");

  7. #7
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Need a bit of PHP help (probably very easy!)

    I have seen functioning code before with incomplete <li> tags. Apparently browsers will try to make incomplete HTML work rather than throw it out. I think it used to be common to leave tags hanging, and there is still legacy code floating around and being reused.

  8. #8
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,871
    Plugin Contributions
    96

    Default Re: Need a bit of PHP help (probably very easy!)

    Quote Originally Posted by gjh42 View Post
    I have seen functioning code before with incomplete <li> tags. Apparently browsers will try to make incomplete HTML work rather than throw it out. I think it used to be common to leave tags hanging, and there is still legacy code floating around and being reused.
    Agreed, but this is regarding email viewers which can have their own peculiarities.

  9. #9
    Join Date
    Feb 2008
    Location
    Ann Arbor, MI
    Posts
    26
    Plugin Contributions
    0

    Default Re: Need a bit of PHP help (probably very easy!)

    So, first I tried RodG's suggestion of escaping the quotes in the link. That had no effect.

    Then I tried closing all the li tags per lat9's suggestion - actually, I had thought it was strange that they weren't closed in the original code! - but still no effect.

    Just for kicks, I also tried bislewl's suggestion, although the link I need there is not a link to the store home page, but a link to the home page of the entire website that contains the store.

    So, I STILL don't know what's wrong. It's extra frustrating that there doesn't seem to be a way to view the source code of an email so I can see what it is even doing?? I tried View > Message > Raw Source in Apple Mail but didn't show the HTML code that is behind the email, just all the headers and stuff.

    I think my next step will be to create a user account for my husband so that he gets the welcome email and see if it looks any different in his email program (probably not, but it's worth a try)

    I am still holding out hope that maybe someone will see this and spot something. It makes no sense that the other links in the email come through as links just fine, but the one I created doesn't!

  10. #10
    Join Date
    Feb 2008
    Location
    Ann Arbor, MI
    Posts
    26
    Plugin Contributions
    0

    Default Re: Need a bit of PHP help (probably very easy!)

    Update: In my husband's email the sign up link is still not clickable NOR is the mailto link for the store's contact email (that was clickable in my email program, but perhaps that is just a difference in the way mail programs handle mailto links). The store link at the bottom IS clickable in his email as well.

    So I'm still thinking SOMETHING has got to be wrong with the way I constructed the sign up link...

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Help, i need help finding this bit of code
    By dbj-media in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 9 Apr 2009, 01:33 AM
  2. Need help on a bit of cold
    By redrob in forum General Questions
    Replies: 4
    Last Post: 22 Feb 2009, 12:43 AM
  3. Almost done, need a bit of help
    By yd29999 in forum General Questions
    Replies: 1
    Last Post: 16 Dec 2008, 01:07 PM
  4. Url question (probably very easy)
    By jvanree in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 6 May 2008, 01:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg