Use Trigger Data in automation Action

I have an automation that looks at my phones Last notification state, and if it’s a text message performs this action (only for testing):

service: Notify.SMTPAddress
data:
  message: "{{ trigger.to_state.state }} {{ trigger.to_state }}"
  title: test email
  target: [email protected]
  data:
    from: [email protected]
enabled: true

When I look at the trace I see the following data (only a sample, not all as it’s pretty long:

params:
  domain: notify
  service: EmailAddress
  service_data:
    message: >-
      744f <state sensor.sm_g986u_last_notification=744f;
      android.appInfo=ApplicationInfo{bfc6f38 com.samsung.android.messaging},
      android.conversationUnreadMessageCount=0,
      android.hiddenConversationTitle=null, 
	  android.infoText=null,
      android.isGroupConversation=False, 
	  android.largeIcon=Icon(typ=BITMAP
      size=90x90), 
	  android.messages=['
	    {extras={},
		sender_person=android.app.Person@a70dab32,
		sender=\u2068+PhoneNumber\u2069, text=Y, time=1714589805000}',
      '{extras={}, sender_person=android.app.Person@8f1f3a17,
      sender=\u2068+**PhoneNumber**\u2069, text=G, time=1714589917000}',

How would I get the PhoneNumber from the Trigger.??? in the automation action?

It’s hard to tell with the state object cut in half, but I think it should be:

{{ (trigger.to_state.attributes['android.messages'][0]['sender']).replace('\u2068', '').replace('\u2069', '') }}

Thank you, not really sure why I didn’t think of attributes. Still not a 100% working, but it’s a start.