public void sendResetPassword( String email, String password ) { StringBuilder body = new StringBuilder(); body.append( "Your password has been reset. Your new password is: " ); body.append( password ); MailRequest request = nexusEmailer.getDefaultMailRequest( "Nexus: User account notification.", body.toString() ); request.getToAddresses().add( new Address( email ) ); nexusEmailer.sendMail( request ); } }
public void sendForgotUsername( String email, List<String> userIds ) { StringBuilder body = new StringBuilder(); body.append( "Your email is associated with the following Nexus User Id(s):\n " ); for ( String userId : userIds ) { body.append( "\n - \"" ); body.append( userId ); body.append( "\"" ); } MailRequest request = nexusEmailer.getDefaultMailRequest( "Nexus: User account notification.", body.toString() ); request.getToAddresses().add( new Address( email ) ); nexusEmailer.sendMail( request ); }
public void sendNewUserCreated( String email, String userid, String password ) { StringBuilder body = new StringBuilder(); body.append( "User Account " ); body.append( userid ); body.append( " has been created. Another email will be sent shortly containing your password." ); MailRequest request = nexusEmailer.getDefaultMailRequest( "Nexus: New user account created.", body.toString() ); request.getToAddresses().add( new Address( email ) ); nexusEmailer.sendMail( request ); body = new StringBuilder(); body.append( "Your new password is " ); body.append( password ); request = nexusEmailer.getDefaultMailRequest( "Nexus: New user account created.", body.toString() ); request.getToAddresses().add( new Address( email ) ); nexusEmailer.sendMail( request ); }
/** * Performs a formal validation of an e-mail address. * * @param address string representing an e-mail address. * @throws IllegalArgumentException */ public static void validateAddress( final String address ) throws IllegalArgumentException { if ( Strings.isEmpty( address ) ) { throw new IllegalArgumentException( "E-mail address cannot be empty!" ); } validateAddress( new Address( address ) ); }
/** * {@inheritDoc} */ public void sendNexusTaskFailure( final String email, final String taskId, final String taskName, final Throwable cause ) { final StringBuilder body = new StringBuilder(); if ( taskId != null ) { body.append( String.format( "Task ID: %s", taskId ) ).append( "\n" ); } if ( taskName != null ) { body.append( String.format( "Task Name: %s", taskName ) ).append( "\n" ); } if ( cause != null ) { final StringWriter sw = new StringWriter(); final PrintWriter pw = new PrintWriter( sw ); cause.printStackTrace( pw ); body.append( "Stack trace: " ).append( "\n" ).append( sw.toString() ); } MailRequest request = nexusEmailer.getDefaultMailRequest( "Nexus: Task execution failure", body.toString() ); request.getToAddresses().add( new Address( email ) ); nexusEmailer.sendMail( request ); }
public Address getSMTPSystemEmailAddress() { return new Address( getCurrentConfiguration( false ).getSystemEmailAddress(), NEXUS_SENDER_NAME ); }
String systemName = settings.getString(Mailer.Setting.mail_systemName, "Fathom"); String systemAddress = settings.getString(Mailer.Setting.mail_systemAddress, "fathom@gitblit.com"); request.setFrom(new Address(systemAddress, systemName));
String systemName = settings.getString(Mailer.Setting.mail_systemName, "Fathom"); String systemAddress = settings.getString(Mailer.Setting.mail_systemAddress, "fathom@gitblit.com"); request.setFrom(new Address(systemAddress, systemName));
new Address(settings.getSystemEmailAddress().trim()));
new Address( settings.getSystemEmailAddress().trim() ) );