Background
I have found styling attributes not functioning on the merge tags, either apply attributes separately or apply a style.
Known Solutions
Apply styling attributes on the tag that make use of the layout works. For example, include tags and custom tags.
Just don't make use of merge.
Apply styling programmatically.
However, I am looking for better solutions.
Why?
It is messy. I have to apply the styling attributes every time I make use of the layout. I make it as an separated layout because they are meant to be reused.
I am intentionally using merge tag as they have to be the immediate children of the parent layout. For example, the tags are children of a LinearLayout. I apply layout_width="0dp" and layout_weight="1" to have them equally spanning in the parent layout.
Reason #2 plus the tags are generated programmatically. Thus, I can only apply styling programmatically. It is ugly and extra efforts are needed for maintenance.
Goal
Satisfactory workaround(s).
XML Tags for Illustration Purpose
<merge xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/CustomStyle">
<!-- Omitted -->
</merge>
And
<merge xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<!-- Omitted -->
</merge>
Both the above tags are not styled.
If it still seems like merge tags aren't working, try to send a test email to yourself or a small test segment. Be sure your test email accounts have default values for each merge value in your campaign, and segment your audience to send to only these test addresses.
Click the Manage Audience drop-down and choose Settings. On the Settings page, click Audience fields and *|MERGE|* tags. In the fields in the Default value column, type the default values for your merge tags. When you're done, click Save Changes.
The information you collect through your Mailchimp signup form is saved in an audience field and tied to a unique label, called a merge tag. Use merge tags to insert personalized or dynamic content into the campaigns you send.
Merge tags are also known as personalization fields or personalization tags. Merge tags allow you to insert ("merge") data from your mailing list directly into your email campaigns. For example, if you'd like to insert your subscriber's first name into your email, you use the merge tag #[FNAME]#.
attributes in a merge tag are ignored. When the XML parser sees a merge tag, it tells it, "Skip this tag and add all of the children directly."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With