email.pm 598 B

12345678910111213141516171819202122232425262728
  1. package Trog::Renderer::email;
  2. use strict;
  3. use warnings;
  4. no warnings 'experimental';
  5. use feature qw{signatures state};
  6. use parent qw{Trog::Renderer::Base};
  7. use Text::Xslate;
  8. use Trog::Themes;
  9. use Trog::Renderer::html;
  10. =head1 Trog::Renderer::email
  11. Render emails with both HTML and email parts, and inline all CSS/JS/Images.
  12. =cut
  13. # TODO inlining
  14. sub render (%options) {
  15. my $text = Trog::Renderer::Base::render( %options, contenttype => 'text/plain' );
  16. my $html = Trog::Renderer::html::render( %options, contenttype => 'text/html' );
  17. return { text => $text, html => $html };
  18. }
  19. 1;