[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: How to change email "From" field in order receipt
>****** message to minivend-users from "JR" <jr@clara.net> ******
>
>Hi all
>
>My orders are arriving with the email "From:" field as
>"minivend@my.domain.com". I would like to be able to re-define this to be,
>for instance, "sales@my.domain.com" or indeed anything else.
>
>I know there has been some correspondence about this already, but I can't
>find an answer in the list that works for me, and I wonder if anybody can
>tell me the definitive way of doing this.
>
>So far as I can see, the emailing of the orders is done by Util.pm, and the
>emailing routine in there doesn't specifically use the "From:" field.
>
>But it does have "my($to, $subject, $body, $reply, $use_mime,
>@extra_headers) = @_;" Am I right in thinking that @extra_headers COULD
>contain the "From:" field, but if so, how and where would I put the field
>and in which page to make it appear there??? (In receipt.html, report.html,
>checkout.html, or is it somewhere altogether different?)
>
>I can't presently work out where the send_mail routine in Util.pm actually
>gets any of its fields from, anyway!!! Any help much appreciated.
>
>Thanks
>
>Jerry Rodwell
The send_mail in Util.pm gets the values from regular black magic. Order.pm
calls send_mail in line 588 (minivend 3.14) of Order.pm with:
$ok = send_mail($email, $subject, $body);
To get any extra headers I guess you would have to change this to:
$ok = send_mail($email, $subject, $body, undef, undef, @extra);
And then construct the extra header array somewhere above that line from
session values.
I am not quite sure whether the From: line can come after the other headers
though, as sendmail is advanced black magic. You probably can cheat and
replace the "Reply-to" with "From" in Util.pm, this will usually work. Then
you need to change the above line to:
$ok = send_mail($email, $subject, $body, $from);
and set $from from session values to anything you like.
Cheers, Frank
--
Frank Miedreich
Max-Planck-Institut fuer psychologische Forschung
Leopoldstr. 24 80802 Muenchen +49 89 38602-237