Gossamer Forum
Home : Products : Gossamer Links : Discussions :

link_added.eml and link_modified.eml not parsing tags

Quote Reply
link_added.eml and link_modified.eml not parsing tags
Greetings:

I have a number of fields that contain multiple values eg. blue car, red train, yellow bus etc. This field may be called <%vehicle_type%>.

When a user adds/modifies a link these values are not passed through in the email to the user. I have the following in link_added.eml:

Code:
<%if vehicle_type%>
<ul>
<%if vehicle_type contains 'blue car'%><li>Blue Car</li><%endif%>
<%if vehicle_type contains 'red train'%><li>Red Train</li><%endif%>
<%if vehicle_type contains 'yellow bus'%><li>Yellow Bus</li><%endif%>
</ul>
<%else%><p>No value entered</p><%endif%>

The values always come through blank for some reason, however, this does work in other templates (non-email) such as category.html and even modify_success.html etc.

Any ideas what is occurring here?


Regards,


Clint.
--------------------------
http://AffiliatesDirectory.com
The Affiliate Programs Directory
Quote Reply
Re: [Clint] link_added.eml and link_modified.eml not parsing tags In reply to
This is all you should need:

Vehicle Type: <%vehicle_type%>

or

Vehicle Type: <%if vehicle_type%> <%vehicle_type%> <%else%> No value entered<%endif%>
Quote Reply
Re: [Clint] link_added.eml and link_modified.eml not parsing tags In reply to
What settings do you have for add/modify (eg. user_direct_mod) and are you using payments? Also, one thing you might try is to add <%DUMP%> in the e-mail template to show all the template variables. Lastly, is vehicle_type a column in the Links table?

Adrian
Quote Reply
Re: [brewt] link_added.eml and link_modified.eml not parsing tags In reply to
Hi Adrian:

user_direct_mod is off.

I'm not using Payments.

<%vehicle_type% is definately a column, as the correct data is displayed from this column when links are added/modified in add_success.html and modify_success.html templates. They are also correctly displayed and interpreted in all html templates except in the email that gets sent out to users once they add/modify their links.

It also seems to (in the email template) identify that something is in the <%vehicle_type%> column as the html I get in the email as as follows:-

Code:
<ul>
</ul>

which shows that the <%if vehicle_type%> is working, but the <%if vehicle_type contains 'value'%><li>abcdef</li><%endif%> is not working (in the email templates - but as I indicated, it works elsewhere).


Regards,


Clint
--------------------------
http://AffiliatesDirectory.com
The Affiliate Programs Directory
Quote Reply
Re: [Clint] link_added.eml and link_modified.eml not parsing tags In reply to
Just print <%vehicle_type%> then. There's a value in it or it wouldn't go into that block.

Adrian
Quote Reply
Re: [brewt] link_added.eml and link_modified.eml not parsing tags In reply to
Adrian:

Definately values in that column - as they do display in the other templates.

Thanks,

Clint.
--------------------------
http://AffiliatesDirectory.com
The Affiliate Programs Directory
Quote Reply
Re: [Clint] link_added.eml and link_modified.eml not parsing tags In reply to
Yes, there are values in the column, just not what you think they are (none of the three values that you check for).

Adrian
Quote Reply
Re: [brewt] link_added.eml and link_modified.eml not parsing tags In reply to
Hi Adrian:

Actually the values that I am checking for 'do' exist. I just can't work out why they will be displayed correctly in the add_success.html but not in the email that gets sent out ....


Thanks,

Clint.
--------------------------
http://AffiliatesDirectory.com
The Affiliate Programs Directory
Quote Reply
Re: [Clint] link_added.eml and link_modified.eml not parsing tags In reply to
Print what the value is in the e-mail and I'm pretty sure that will explain what's going on.

Adrian
Quote Reply
Re: [Clint] link_added.eml and link_modified.eml not parsing tags In reply to
Hi,

You could also add : <%GT::Template::dump%> in the template, and also change the "Extra Headers" bit, to format in HTML - with:

Code:
Content-Type: text/html

* be sure to the extra newline after it, or it won't work right from previous experience :)

Then, add / validate a link - and look at the template dump to see what the value of the tag you are looking is.

Hope that helps

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] link_added.eml and link_modified.eml not parsing tags In reply to
Hi Andy:

Did that and the values of the tag are certainly there. When I just put in the tag itself, rather than do any conditionals, I get this in the email:


  • ARRAY(0x8b711f4)


Regards,

Clint.
--------------------------
http://AffiliatesDirectory.com
The Affiliate Programs Directory
Quote Reply
Re: [Clint] link_added.eml and link_modified.eml not parsing tags In reply to
Either you're passing in more than one value (ie. more than one option is selected), or some code is causing it to be changed into an array.

Adrian
Quote Reply
Re: [brewt] link_added.eml and link_modified.eml not parsing tags In reply to
Adrian:

Yep .... that sounds like it. Users can actually select multiple items via checkboxes that all go into that column.... that may be why it displays correctly on the html templates and not on the mailing templates.

Is there any way to work around this problem?


Thanks,


Clint.
--------------------------
http://AffiliatesDirectory.com
The Affiliate Programs Directory
Quote Reply
Re: [brewt] link_added.eml and link_modified.eml not parsing tags In reply to
Adrian:

I'm assuming that arrays (or multiple values for a column) cannot be passed to the email templates, but obviously can in the html templates. Is this right?


Thanks,


Clint.
--------------------------
http://AffiliatesDirectory.com
The Affiliate Programs Directory
Quote Reply
Re: [Clint] link_added.eml and link_modified.eml not parsing tags In reply to
Hi,

Only thing I can think of - is maybe a global:
Code:
<%global_name($vehicle_type)%>
<ul>
<%loop%>
<li><%value%></li>
<%endloop%>
</ul>


Code:
sub {

my @in = $_[0];
my @loop;
foreach (@in) {
push @loop, { value => $_ }
}
return { vehicle_type_loop => \@loop }
}

Not 100% sure that will work - but worth a try :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!