Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Links::send_email get_body with subject

Quote Reply
Links::send_email get_body with subject
Hi there,

just wanted to share and kind of write down for myslef the following.
I use another way to send E-Mails and felt it was kind of handy not to get only the mail body but also the subject.
Not sure if this is the best way but I found some place in Links.pm in


Code:
sub send_email {
...
my $mail = new GT::Mail;
$mail->top_part($top);

+ return {
+ body => $mail->{head}->{data},
+ subject => $mail->{head}->{header_lines}->{subject}[0]
+ } if $opts->{get_body_and_subject};
+
my %send_opts;
if ($CFG->{db_smtp_server}) {

Now you get:

Code:
$mail_stuff = Links::send_email('mail_template.eml',
{ %$vars, %ENV },
{ get_body_and_subject => 1 });

Happy to hear any comments

Niko
Subject Author Views Date
Thread Links::send_email get_body with subject el noe 5245 Jun 9, 2020, 12:59 PM
Thread Re: [el noe] Links::send_email get_body with subject
Andy 5098 Jun 12, 2020, 1:26 AM
Thread Re: [Andy] Links::send_email get_body with subject
el noe 5096 Jun 12, 2020, 4:33 AM
Thread Re: [el noe] Links::send_email get_body with subject
Andy 5089 Jun 12, 2020, 5:59 AM
Thread Re: [Andy] Links::send_email get_body with subject
el noe 5052 Jun 14, 2020, 11:53 AM
Post Re: [el noe] Links::send_email get_body with subject
Andy 5034 Jun 14, 2020, 11:03 PM