You can use variables in the mailing texts (Subject, Body and HTML Body) to have the values of contact person fields inserted into the generated emails. For this, and for the purpose of generating content by means of a script, the Liquid templating language is available. Learn more about how Liquid templates are used in the WebCRM.
In short, to insert field values into the mailing text, use a pair of double braces:
You, as a {{contact.job_title}}, might be interested in...
Next to the contact keyword for querying the respective recipient of the email, the mailing keyword for accessing the data of the mailing concerned is available. Thus, if the mailing is associated with an event, it can be accessed using mailing.event to retrieve event data such as mailing.event.location. The names of the fields that can be retrieved are listed below.