Class SocialNetworkRegistry

java.lang.Object
dev.jcputney.mjml.util.SocialNetworkRegistry

public final class SocialNetworkRegistry extends Object
Registry of known social networks with default icon URLs, colors, and share URLs. Used by MjSocialElement to resolve network-specific defaults from the name attribute.
  • Method Details

    • getNetwork

      public static SocialNetworkRegistry.NetworkInfo getNetwork(String name)
      Returns the SocialNetworkRegistry.NetworkInfo for the given network name, or null if the name is not recognized. The name may include a variant suffix such as "facebook-noshare" — the base name is extracted by splitting on '-'.
      Parameters:
      name - the network identifier (case-insensitive, e.g. "facebook", "twitter", "linkedin")
      Returns:
      the network info, or null if unknown
    • getIconUrl

      public static String getIconUrl(String name)
      Returns the default icon URL for the given network name. The URL follows the pattern: https://www.mailjet.com/images/theme/v1/icons/ico-social/{baseName}.png
      Parameters:
      name - the network identifier
      Returns:
      the icon URL, or an empty string if the name is null/empty