Gossamer Forum
Home : Products : Gossamer Mail : Discussion :

Image next to message from admin...How To?

Quote Reply
Image next to message from admin...How To?
All the messages from Admin (admin@domain) had this image right at the begining of the row (after the checkbox) by having the following in template msgs_list_include.htm at the right place:



<%if msgs_sent_from eq 'admin@domain'%><img src="<%url_images%>/templates/<%t%>/admin.gif" alt="Message From Administrator"><%endif%>

It was all working fine till i decded to change the From Adress of Welcome Mail of the format:

"Webmaster"<webmaster@<%domain%>>

I tried changing the above conditional statement and i just couldn't get the Image back.

Is there a way of getting it back with the New Format of the From address.

I have already tried the following:

<%if msgs_sent_from eq 'Webmaster<webmaster@<%domain%>>'%><img src="<%url_images%>/templates/<%t%>/admin.gif" alt="Message From Administrator"><%endif%>

<%if msgs_sent_from eq '"Webmaster"<webmaster@<%domain%>'%> also does not work

The image just doesn't appear. Any clue? Am i missing something critical or it just can't be done? In fact the icon above was intended to make the message stand out from rest as being from Administrator.

Anup

Last edited by:

anup123: May 26, 2003, 8:20 AM
Quote Reply
Re: [anup123] Image next to message from admin...How To? In reply to
Is it impossible to get the image back in status row with the from admin email address as "Webmaster"<webmaster<%domain%>>

Actually this format was taken for two reasons:

1. To make the from column less cluttered with those long email address of admin in case of long domain names.

2. Have domain specific from addresses instead of one <%admin_email%>

I never thought that it would be impossible to get the image back and I was goofing somewhere (still a newbie on template though have learnt to walk now) ;-)

Thnx

Anup
Quote Reply
Re: [anup123] Image next to message from admin...How To? In reply to
Hi Anup,

You're going to have to use a template global to do that as GT::Template doesn't supported nested tags (tags inside tags) in basic comparisons. Basically, you want to create a global called is_admin, with the content:

Code:
sub {
my ($from, $domain) = @_;
return $from eq qq|"Webmaster"<webmaster\@$domain>|;
}

Then, in the template, just use:

<%if is_admin($msgs_sent_from, $domain)%>....<%endif%>

You can tweak the text between the qq| and the | if the actual admin e-mail address changes.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] Image next to message from admin...How To? In reply to
Hi Jason,

I knew it was possible but it needed someone from GT to show the way. Being good at just ctrl+c and ctrl+v i managed to get the image back with following:

Code:
sub {
my ($msgs_sent_from, $domain) = @_;
return $from eq qq|"WebMaster"<webmaster\@$domain>|;
}

And then including the necessary <%if is_admin....>...<%endif%> in templates.

Thnx a lot. I am a step closer now to finishing the HM style Templates...

Smile

Anup
Quote Reply
Re: [Jagerman] Image next to message from admin...How To? In reply to
Hi Jason,

I tried and either i get images in all the messages or none of them. Had also PM'ed on this to you. Any suggestions.

Thnx

Anup
Quote Reply
Re: [Jagerman] Image next to message from admin...How To? In reply to
Hi,

OK I just went about it a more cumbersome (and possibly crude) way.

admin_image.htm

<%if msgs_sent_from like 'webmaster@domain1' or .........%>.....<%endif%>

and <%include admin_image.htm%> in therelevant position on the messages list template and got back the images...

Crude but serves the purpose.....

Anup