com.mailgun.util.EmailUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mailgun-java Show documentation
Show all versions of mailgun-java Show documentation
The Mailgun SDK for Java enables Java developers to work with Mailgun API
efficiently.
The newest version!
package com.mailgun.util;
import lombok.experimental.UtilityClass;
import org.apache.commons.lang3.StringUtils;
@UtilityClass
public class EmailUtil {
/**
*
* Method concatenates the username and email address of the user.
*
*
* @param name username
* @param email email address of the user
* @return concatenated result
*/
public static String nameWithEmail(String name, String email) {
return StringUtils.isBlank(name) ? email : name + " <" + email + ">";
}
}