def get_html_email_body(template_content, template_values): return Take.as_field(template_content, template_values, html='escape', markdown_lists=True).then(unlink_govuk_escaped).then( prepare_newlines_for_markdown).then( notify_email_markdown).as_string
def __str__(self): return Markup( self.jinja_template.render({ 'admin_base_url': self.admin_base_url, 'logo_file_name': self.logo_file_name, 'subject': self.subject, 'message': Take.as_field( strip_dvla_markup(self.content), self.values, html='escape', markdown_lists=True).then(strip_pipes).then( prepare_newlines_for_markdown).then( notify_letter_preview_markdown).as_string, 'address': Take.as_field( self.address_block, (self.values_with_default_optional_address_lines if all( Columns(self.values).get(key) for key in { 'address line 1', 'address line 2', 'postcode', }) else self.values), html='escape', with_brackets=False).then(strip_pipes).then( remove_empty_lines).then(nl2br).as_string, 'contact_block': Take.as_field( '\n'.join(line.strip() for line in self.contact_block.split('\n')), self.values, html='escape', ).then(nl2br).then(strip_pipes).as_string, 'date': datetime.utcnow().strftime('%-d %B %Y') }))
def __str__(self): return Markup( self.jinja_template.render({ 'recipient': Field('((phone number))', self.values, with_brackets=False, html='escape'), 'show_recipient': self.show_recipient, 'body': Take.as_field(self.content, self.values, html='escape').then( add_prefix, (escape_html(self.prefix) or None) if not self.sender else None).then(gsm_encode).then(nl2br).as_string }))
def __str__(self): OTT = '140' ORG_ID = self.org_id ORG_NOTIFICATION_TYPE = '001' ORG_NAME = '' NOTIFICATION_ID = self.notification_reference NOTIFICATION_DATE = '' CUSTOMER_REFERENCE = '' ADDITIONAL_LINE_1, \ ADDITIONAL_LINE_2, \ ADDITIONAL_LINE_3, \ ADDITIONAL_LINE_4, \ ADDITIONAL_LINE_5, \ ADDITIONAL_LINE_6, \ ADDITIONAL_LINE_7, \ ADDITIONAL_LINE_8, \ ADDITIONAL_LINE_9, \ ADDITIONAL_LINE_10 = [ line.strip() for line in (( Take.as_field(self.contact_block, self.values, html='strip_dvla_markup') ).as_string.split('\n') + ([''] * 10)) ][:10] TO_NAME_1,\ _,\ TO_ADDRESS_LINE_1,\ TO_ADDRESS_LINE_2,\ TO_ADDRESS_LINE_3,\ TO_ADDRESS_LINE_4,\ TO_ADDRESS_LINE_5,\ TO_POST_CODE, = str(Field( self.address_block, self.values_with_default_optional_address_lines, )).split('\n') TO_NAME_2 = '' RETURN_NAME = '' RETURN_ADDRESS_LINE_1 = '' RETURN_ADDRESS_LINE_2 = '' RETURN_ADDRESS_LINE_3 = '' RETURN_ADDRESS_LINE_4 = '' RETURN_ADDRESS_LINE_5 = '' RETURN_POST_CODE = '' SUBJECT_LINE = '' NOTIFICATION_BODY = ( '{}<cr><cr>' '<h1>{}<normal><cr><cr>' '{}' ).format( datetime.utcnow().strftime('%-d %B %Y'), self.subject, Take.as_field( self.content, self.values, markdown_lists=True, html='strip_dvla_markup').then(prepare_newlines_for_markdown). then(notify_letter_dvla_markdown).then( fix_extra_newlines_in_dvla_lists).as_string) return '|'.join( strip_pipes(line) for line in [ OTT, ORG_ID, ORG_NOTIFICATION_TYPE, ORG_NAME, NOTIFICATION_ID, NOTIFICATION_DATE, CUSTOMER_REFERENCE, ADDITIONAL_LINE_1, ADDITIONAL_LINE_2, ADDITIONAL_LINE_3, ADDITIONAL_LINE_4, ADDITIONAL_LINE_5, ADDITIONAL_LINE_6, ADDITIONAL_LINE_7, ADDITIONAL_LINE_8, ADDITIONAL_LINE_9, ADDITIONAL_LINE_10, TO_NAME_1, TO_NAME_2, TO_ADDRESS_LINE_1, TO_ADDRESS_LINE_2, TO_ADDRESS_LINE_3, TO_ADDRESS_LINE_4, TO_ADDRESS_LINE_5, TO_POST_CODE, RETURN_NAME, RETURN_ADDRESS_LINE_1, RETURN_ADDRESS_LINE_2, RETURN_ADDRESS_LINE_3, RETURN_ADDRESS_LINE_4, RETURN_ADDRESS_LINE_5, RETURN_POST_CODE, SUBJECT_LINE, NOTIFICATION_BODY, ])
def subject(self): return Take.as_field( self._subject, self.values, html='escape').then(strip_pipes).then(strip_dvla_markup).as_string
def __str__(self): return Take.as_field( self.content, self.values, html='passthrough', markdown_lists=True).then(unlink_govuk_escaped).as_string
def __str__(self): return Take.as_field( self.content, self.values, html='passthrough').then( add_prefix, self.prefix).then(gsm_encode).as_string.strip()