Gossamer Forum
Quote Reply
Email All
Within Links SQL Email Function...

If I select the option "Email All Users" can I use all the link & user properties to send out an email to all of them.. for example

========================
Dear <%username%>

Your Listings <%Title%> has been added at our domain.com and you can view it at www.domain.com/detailed/<%ID%>.html

Thank you.
Web Site Owner
========================

Thanks for the help.

Vishal Thakkar

Vishal
-------------------------------------------------------
Quote Reply
Re: [NeedScripts.Com] Email All In reply to
You'll need a global. Here's an example.

http://www.gossamer-threads.com/...i?post=247015#247015
Quote Reply
Re: [afinlr] Email All In reply to
Hi Laura,

Thanks for the help, however the global does not seem to be working.

Let me try to put in other words what kind of email I am wanting to send:

==========================================

Dear <%Username%>

Your Listings at www.domain.com has been accepted and you can view it at http://www.domain.com/...ed/<%ID%>.html

To modify your listings, use below information

Login URL : http://www.domain.com/login.cgi
Username :: <%Username%>
Password :: <%Password%>

User Info:
Name
: <%Name%>
Email : <%Email%>
Company Name : <%Company_Name%>
Support Phone : <%Support_Phone%>


Below is information about your Listing/s
-----------
Listing # 1
-----------
Title :: <%Title%>
Description :: <%Description%>
URL :: <%URL%>
Opearting System :: <%OS%>

-----------
Listing # 2
-----------
Title :: <%Title2%>
Description :: <%Description%>
URL :: <%URL%>
Opearting System :: <%OS%>

-----------
Listing # 3
-----------
Title :: <%Title3%>
Description :: <%Description%>
URL :: <%URL%>
Opearting System :: <%OS%>

For answers to your questions, contact us at support@domain.com

Thank you.

Link Manager
Domain.Com
==========================================

In the above Email... Title, Description, OS, URL are Link Properties, While Username, Password, Support_Phone and Company_Name are user properties.

Can you tell me how can this be done.

Thanks for the help.

Vishal Thakkar

Vishal
-------------------------------------------------------
Quote Reply
Re: [NeedScripts.Com] Email All In reply to
I would use a loop.

sub {
my ($rec) = @_;
my $name = $rec->{Username};
my $db = $DB->table ('Links');
my $sth = $db->select ( { 'LinkOwner' => $name });
my @links;
while (my $link = $sth->fetchrow_hashref){
push @links, $link;
}
return {Link_Loop=>\@links};
}

Then where you want the listings you can put

<%globalname%> - (whatever you call the global above)

<%loop Link_Loop%>

-----------
Listing # <%row_num%>
-----------
Title :: <%Title%>
Description :: <%Description%>
URL :: <%URL%>
Operating System :: <%OS%>

<%endloop%>