Revision 6092ef39
Von Moritz Bunkus vor fast 3 Jahren hinzugefügt
SL/DN.pm | ||
---|---|---|
487 | 487 |
} or die $main::locale->text('No email for user with login #1 defined.', $ref->{invoice_employee_login}); |
488 | 488 |
} |
489 | 489 |
|
490 |
my $html_template = SL::Template::create(type => 'HTML', form => $form, myconfig => $myconfig); |
|
491 |
$html_template->set_tag_style('<%', '%>'); |
|
492 |
|
|
490 | 493 |
my $template = SL::Template::create(type => 'PlainText', form => $form, myconfig => $myconfig); |
491 | 494 |
my $mail = Mailer->new(); |
492 | 495 |
$mail->{bcc} = $form->get_bcc_defaults($myconfig, $form->{bcc}); |
493 | 496 |
$mail->{from} = $from; |
494 | 497 |
$mail->{to} = $ref->{recipient}; |
495 | 498 |
$mail->{subject} = $template->parse_block($ref->{email_subject}); |
496 |
$mail->{message} = $template->parse_block($ref->{email_body}); |
|
499 |
$mail->{message} = $html_template->parse_block($ref->{email_body}); |
|
500 |
$mail->{content_type} = 'text/html'; |
|
497 | 501 |
my $sign_backup = $::myconfig{signature}; |
498 | 502 |
$::myconfig{signature} = $sign if $sign; |
499 | 503 |
$mail->{message} .= $form->create_email_signature(); |
SL/Form.pm | ||
---|---|---|
436 | 436 |
common part_selection |
437 | 437 |
), "jquery/ui/i18n/jquery.ui.datepicker-$::myconfig{countrycode}"); |
438 | 438 |
|
439 |
$layout->use_javascript("$_.js") for @{ $params{use_javascripts} // [] }; |
|
440 |
|
|
439 | 441 |
$self->{favicon} ||= "favicon.ico"; |
440 | 442 |
$self->{titlebar} = join ' - ', grep $_, $self->{title}, $self->{login}, $::myconfig{dbname}, $self->read_version if $self->{title} || !$self->{titlebar}; |
441 | 443 |
|
bin/mozilla/dn.pl | ||
---|---|---|
317 | 317 |
$main::auth->assert('dunning_edit'); |
318 | 318 |
|
319 | 319 |
$form->{"title"} = $locale->text("Set eMail text"); |
320 |
$form->header(no_layout => 1); |
|
320 |
$form->header( |
|
321 |
no_layout => 1, |
|
322 |
use_javascripts => [ qw(ckeditor/ckeditor ckeditor/adapters/jquery) ], |
|
323 |
); |
|
321 | 324 |
print($form->parse_html_template("dunning/set_email")); |
322 | 325 |
|
323 | 326 |
$main::lxdebug->leave_sub(); |
sql/Pg-upgrade2/convert_columns_to_html_for_sending_html_emails2.pl | ||
---|---|---|
1 |
# @tag: convert_columns_to_html_for_sending_html_emails2 |
|
2 |
# @description: Versand von E-Mails in HTML: weitere Text-Spalten nach HTML umwandeln |
|
3 |
# @depends: convert_columns_to_html_for_sending_html_emails |
|
4 |
package SL::DBUpgrade2::convert_columns_to_html_for_sending_html_emails2; |
|
5 |
|
|
6 |
use strict; |
|
7 |
use utf8; |
|
8 |
|
|
9 |
use parent qw(SL::DBUpgrade2::Base); |
|
10 |
|
|
11 |
use SL::HTML::Util; |
|
12 |
|
|
13 |
sub convert_column { |
|
14 |
my ($self, $table, $id_column, $column_to_convert, $condition) = @_; |
|
15 |
|
|
16 |
$condition = $condition ? "WHERE $condition" : ""; |
|
17 |
|
|
18 |
my $q_fetch = <<SQL; |
|
19 |
SELECT ${id_column}, ${column_to_convert} |
|
20 |
FROM ${table} |
|
21 |
${condition} |
|
22 |
SQL |
|
23 |
|
|
24 |
my $q_update = <<SQL; |
|
25 |
UPDATE ${table} |
|
26 |
SET ${column_to_convert} = ? |
|
27 |
WHERE ${id_column} = ? |
|
28 |
SQL |
|
29 |
|
|
30 |
my $h_fetch = $self->dbh->prepare($q_fetch); |
|
31 |
$h_fetch->execute || $::form->dberror($q_fetch); |
|
32 |
|
|
33 |
my $h_update = $self->dbh->prepare($q_update); |
|
34 |
|
|
35 |
while (my $entry = $h_fetch->fetchrow_hashref) { |
|
36 |
$entry->{$column_to_convert} //= ''; |
|
37 |
my $new_value = SL::HTML::Util->plain_text_to_html($entry->{$column_to_convert}); |
|
38 |
|
|
39 |
next if $entry->{$column_to_convert} eq $new_value; |
|
40 |
|
|
41 |
$h_update->execute($new_value, $entry->{id}) || $::form->dberror($q_update); |
|
42 |
} |
|
43 |
} |
|
44 |
|
|
45 |
sub run { |
|
46 |
my ($self) = @_; |
|
47 |
|
|
48 |
$self->convert_column('dunning_config', 'id', 'email_body'); |
|
49 |
|
|
50 |
return 1; |
|
51 |
} |
|
52 |
|
|
53 |
1; |
templates/webpages/dunning/set_email.html | ||
---|---|---|
1 | 1 |
[%- USE T8 %] |
2 |
[%- USE HTML %] |
|
2 |
[%- USE HTML %][%- USE L -%]
|
|
3 | 3 |
<h1>[% title %]</h1> |
4 | 4 |
|
5 | 5 |
<script type="text/javascript"> |
6 | 6 |
<!-- |
7 | 7 |
function email_updated() { |
8 | 8 |
window.opener.document.getElementsByName(document.Form.input_subject.value)[0].value = document.getElementsByName("email_subject")[0].value; |
9 |
window.opener.document.getElementsByName(document.Form.input_body.value)[0].value = document.getElementsByName("email_body")[0].value; |
|
10 |
window.opener.document.getElementsByName(document.Form.input_attachment.value)[0].value = document.getElementsByName("email_attachment")[0].value; self.close(); |
|
9 |
window.opener.document.getElementsByName(document.Form.input_body.value)[0].value = $("#email_body").val(); |
|
10 |
window.opener.document.getElementsByName(document.Form.input_attachment.value)[0].value = document.getElementsByName("email_attachment")[0].value; |
|
11 |
self.close(); |
|
11 | 12 |
} |
12 | 13 |
--> |
13 | 14 |
</script> |
... | ... | |
26 | 27 |
|
27 | 28 |
<tr> |
28 | 29 |
<td valign="top">[% 'Body:' | $T8 %]</td> |
29 |
<td valign="top"><textarea id="email_body" name="email_body" rows="20" cols="70" wrap="soft">[% HTML.escape(email_body) %]</textarea></td>
|
|
30 |
<td valign="top">[% L.textarea_tag('email_body', email_body, rows=20, cols=70, class='texteditor') %]</td>
|
|
30 | 31 |
</tr> |
31 | 32 |
|
32 | 33 |
<tr> |
Auch abrufbar als: Unified diff
Mahnungen: E-Mail-Text als HTML