Sending mail using a boolean input

Hello. I have a small problem: I am reading data from an Omron NX1P2 CPU through MQTT and what I want is after separating the variables to send mail every X time or if I want, through a boolean in the HMI. and I also have a problem with the email construction function. In the Data Select function I have the variables, but when I put the variable that it touches in the mail construction function, it does not read it to me. I attach here the screenshots with the configuration of each function and also a screenshot with what I want to do. Thank you.