'Execute SQL query read the response and from response read property values and insert those values into email template

For Example:(Use Python)
email_template ="""
    Client Nmae: {{clientName}}
    Client ID : {{ clientid }}
    """

1.Once i execute the SQL query the resonse i am getting which is in the string format 2.i want to read that response data and extract few field from the response like ClientName:"Bosch" 3.Once i read Client Name from query then put that clientName value into template. 4.once value is replaced then publish the template on kafka producer.

__producer.produce(topic=constants.KAFKA_EMAIL_TOPIC, key=id, value=email_template, 
callback=_delivery_callback)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source