[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
[mv] email_copy: Adding a "cc" email address to the user's side
****** message to minivend-users from "Greg Goble" <ggo@usia.co.at> ******
Dear Minivend users & Mike Heins,
Mike: See action below.
Yesterday, August 21, I sent out a request asking if
anyone knew how to add a second email address ("cc")
to the user's side of the order. In some cases my request
was confused with adding another or multiple emails on
the admin side, which most of you know can easily be
done in the catalog.cfg.
I've found the solution, in case any of you are interested
(vrs. 3.14-3):
First of all, why might a user (buyer) want to have a second
copy of the email order emailed to another address?
E.g.: Let's say the user is a procurement assistant and is
required to inform his/her supervisor that the order has been
placed. S/he could easily forward his/her copy of the email,
however, in our case we require that the supervisor IS notified
that his/her assistant has placed such an order and therefore,
require that a second email address is submitted...bureaucracy,
I know, but we're not your typically Amazon.com site.
Mike: I would appreciated if you or someone else could double
check this and see if it's okay...thanks.
Here's what I've done:
In the receipt.html (/simple/etc/) file, you will find the email
that is sent to the user, if they chose to receive an email_copy.
I simply added: q{[value cc]}, whereby cc is the value found
in my second email address box on the checkout.html (/pages/ord/) file.
==============================================
[if value email_copy]
[set name=email_copy_sent interpolate=2][perl arg=sub interpolate=2]
form_mail(
q{[value email]},
q{[value cc]},
q{Thank you for your order [value mv_order_number]!},
q{__COMPANY__ Customer Service <__ORDERS_TO__>},
<<'EndOfMail')
..
==============================================
As well, Frank Miedreich pointed out to me that I would most likely
have to make some additions in the form_mail.cfg (/var/mvend/), which I've
done:
Three simple additions where made:
insert $cc into: my(($to, $cc, $subject, $reply, $body) = @_;
insert "Cc: $cc\n", below "To: $to\n",
insert "Cc '$cc'\n" . below "To '$to'\n" .
Script below:
===============================================
GlobalSub <<EndOfSub
sub form_mail {
my
my($ok);
$subject = '<no subject>' unless defined $subject && $subject;
$reply = '' unless defined $reply;
$reply = "Reply-to: $reply\n" if $reply;
$ok = 0;
SEND: {
open(Vend::MAIL,"|$Vend::Cfg->{'SendMailProgram'} -t") or last SEND;
print Vend::MAIL
"To: $to\n",
"Cc: $cc\n",
$reply,
"Subject: $subject\n",
"Errors-To: $Vend::Cfg->{MailOrderTo}\n\n",
$body
or last SEND;
close Vend::MAIL or last SEND;
$ok = ($? == 0);
}
if (!$ok) {
logError("Unable to send mail using
$Vend::Cfg->{'SendMailProgram'}\n" .
"To '$to'\n" .
"Cc '$cc'\n" .
"With subject '$subject'\n" .
"With reply-to '$reply'\n" .
"And body:\n$body");
}
$ok;
}
EndOfSub
=====================================================
I thought that I had to add the $cc in the Order.pm (/var/mvend/lib/Vend/)
to
the sub mail_order under:
my ($email, $order_no) = @_;
but I removed it, ./restarted minivend and my cc still works. So only two
files need to be edited.
That's it, but don't forget to ./restart.
I'm not sure if much credit is owed for such a simple solution, but since I
don't consider myself a programmer, hacker or anything in those lines, I'm
quite pleased
with the with just being a "reverse engineerer"
Feedback is most certainly welcome.
Regards, Greg
********************************************************************
Greg Goble, RPO Vienna Tel: (+43-1) 313 39/73-2757
Internet Publishing Specialist Fax: (+43-1) 408 82 88
********************************************************************
Greg Goble, RPO Vienna Tel: (+43-1) 313 39/73-2757
Internet Publishing Specialist Fax: (+43-1) 408 82 88
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list