Writing scripting languages in AJO | Community
Skip to main content
Level 2
May 9, 2024
Solved

Writing scripting languages in AJO

  • May 9, 2024
  • 1 reply
  • 734 views

Hi,

 

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

 

from flask import Flask, request, jsonify

app = Flask(__name__)
@2509808.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?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SatheeskannaK

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

1 reply

SatheeskannaK
Community Advisor
SatheeskannaKCommunity AdvisorAccepted solution
Community Advisor
May 9, 2024

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

Thanks, Sathees