private void sendHtmlMail( AccountCreationProps props, String to, String from, String subject, String html ) { mailUtils.sendHtmlMail( props.getMailProperties(), to, from, subject, html ); }
/** * Delegates to {@link #sendMail(java.util.Properties, String, String, String, String, String)} with null as the * 'plainText' argument to such. */ public void sendHtmlMail( Properties props, String to, String from, String subject, String html ) { sendMail( props, to, from, subject, null, html ); }
@Before public void setupLocal() { props = new Properties(); props.put( "mail.transport.protocol", "smtp" ); props.put( "mail.smtp.host", "usergrid.com" ); props.put( "mail.smtp.username", "testuser" ); props.put( "mail.smtp.password", "testpassword" ); mailUtils = new MailUtils(); }
logger.error( createErrorMessage( "could not send to bad address", to ), ae ); logger.error( createErrorMessage( "could not deliver message", to ), me );
@Test public void propertiesExtraction() { props.put( "some.other.prop", "foo" ); assertEquals( 5, props.size() ); assertEquals( 4, MailUtils.getMailProperties( props ).size() ); }
private void sendTestEmail( String email ) { mailUtils.sendHtmlMail( props, email, "user@usergrid.com", "test subject", "Email body" ); }
@Test(expected = IllegalArgumentException.class) public void verifyMissingTemplateFail() { mailUtils.sendHtmlMail( props, "foo@bar", "user@usergrid.com", "", "" ); }