author_id => $entry ? $entry->author_id : $tmpl->modified_by,
from => $args->{'from'} || '',
to => $args->{'to'} || '',
+ language => $args->{'language'} || '',
});
if ((! $obj->sent_on || $obj->sent_on =~ m/^0/) && $obj->to) {
$param->{'permalink'} =~ s/#.*//;
$param->{'permalink'} .= '#password'
}
+
+ my $current_language = undef;
+ if (my $lang = $param->{'language'}) {
+ $current_language = MT->current_language;
+ MT->set_language($lang);
+ }
+
my $tmpl = $plugin->load_tmpl('mail_love_letter.tmpl');
my $body = MT->translate_templatized(
$tmpl->output($param)
my $charset = $cfg->MailEncoding || $cfg->PublishCharset;
$head{'Content-Type'} = qq(text/plain; charset="$charset");
+ if ($current_language) {
+ MT->set_language($current_language);
+ }
+
require MT::Mail;
MT::Mail->send( \%head, $body )
or return $app->error( MT::Mail->errstr() );
my $builder = $ctx->stash('builder');
my $tokens = $ctx->stash('tokens');
+ my $current_language = undef;
+ if (my $lang = $args->{'language'}) {
+ $current_language = MT->current_language;
+ MT->set_language($lang);
+ }
+
defined($res = $builder->build($ctx, $tokens, $cond))
or return $ctx->error( $builder->errstr );
</form>
__EOF__
+ if ($current_language) {
+ MT->set_language($current_language);
+ }
+
$res;
}
$param->{'message'} = $app->param('response') || '';
$param->{'ok'} = $app->param('ok') ? 1 : 0;
+ my $current_language = undef;
+ if (my $lang = $param->{'language'}) {
+ $current_language = MT->current_language;
+ MT->set_language($lang);
+ }
+
my $tmpl = $plugin->load_tmpl('mail_response.tmpl');
my $body = MT->translate_templatized(
$tmpl->output($param)
my $charset = $cfg->MailEncoding || $cfg->PublishCharset;
$head{'Content-Type'} = qq(text/plain; charset="$charset");
+ if ($current_language) {
+ MT->set_language($current_language);
+ }
+
require MT::Mail;
MT::Mail->send( \%head, $body )
or return $app->error( MT::Mail->errstr() );