Class SocialNetworkRegistry
java.lang.Object
dev.jcputney.mjml.util.SocialNetworkRegistry
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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordDescribes a social network's display defaults. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetIconUrl(String name) Returns the default icon URL for the given network name.getNetwork(String name) Returns theSocialNetworkRegistry.NetworkInfofor the given network name, ornullif the name is not recognized.
-
Method Details
-
getNetwork
Returns theSocialNetworkRegistry.NetworkInfofor the given network name, ornullif 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
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
-