Expand my Community achievements bar.

Never miss an update of the Adobe Journey Optimizer Community Lens! Subscribe now to get the latest updates, insights, and highlights delivered straight to your inbox every time a new edition drops.
SOLVED

Writing scripting languages in AJO

Avatar

Level 2

Hi,

 

We have the following python script code which we need to execute in AJO

 

from flask import Flask, request, jsonify

app = Flask(__name__)
@app.route('/receive_email_copy', methods=['POST'])def receive_email_copy():
    try:
        # Extract data from the incoming request        data = request.json
        # Process the data as needed        email_content = data.get('email_content')
        recipient = data.get('recipient')
        timestamp = data.get('timestamp')

        # Here you can implement logic to store or utilize the email data# For demonstration purposes, we'll simply print the received dataprint("Received email content:", email_content)
        print("Recipient:", recipient)
        print("Timestamp:", timestamp)

        # Respond with a success messagereturn jsonify({"message": "Email copy received successfully"}), 200except Exception as e:
        # Handle any exceptionsreturn jsonify({"error": str(e)}), 500if __name__ == '__main__':
    app.run(debug=True)

 

Can we write and execute this inside AJO somewhere?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@NeeharikaSh You can't run this in AJO rather take a look at Adobe I/O Runtime if that's helpful.

Thanks, Sathees

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

@NeeharikaSh You can't run this in AJO rather take a look at Adobe I/O Runtime if that's helpful.

Thanks, Sathees