The Calendar Invite
AWS Calendar Invite Server
AWS Calendar Invite Server - Chapter 27 -Get New Event Data from customers that used the Rest API Calendar Invite Send Function
0:00
-17:17

AWS Calendar Invite Server - Chapter 27 -Get New Event Data from customers that used the Rest API Calendar Invite Send Function

"Get New Event Calendar Invite Data" function is gathering data and routing customers to Landing Pages after the Calendar Invite has been sent using the Rest Calendar Invite Send API

This document outlines the technical specifics of the "Get New Event Invite from API" function within a Calendar Invite Server (CIS) Dashboard, hosted on GitHub. It details how the system processes incoming event invitation requests from various external sources using AWS Lambda for API handling and Amazon SNS for queuing. The explanation encompasses the entire event processing flow, including request validation, data extraction, and queuing for further action, highlighting the required and optional parameters for these requests, as well as how errors are handled within the system.

What is the primary purpose of the "Get New Event Invite from API" function?

The "Get New Event Invite from API" function, located within the Calendar Invite Server (CIS) Dashboard, is designed to efficiently process incoming event invite requests that originate from external sources. Its main goal is to validate these requests, extract necessary data, and then queue the invite for further processing.

Which AWS services are fundamental to the operation of this function?

This function heavily relies on two key AWS services:

  • AWS Lambda: This service is responsible for handling API requests, serving as the compute layer that processes incoming new event invites.

  • Amazon SNS (Simple Notification Service): Once an event invite request is validated and data extracted, SNS is used to queue these requests for subsequent handling, ensuring scalability and decoupling of components.

What are the main steps involved in the event processing flow?

The event processing flow can be broken down into four main stages:

  1. Trigger: The function is activated by an API Gateway request, from which relevant parameters are extracted.

  2. Validate Request Data: The system verifies the validity of the request by checking for a proper email and Unique Identifier (UID), and by ensuring the request originates from a recognized source.

  3. Extract Invite Data: Retrieve necessary details, including UID, email, attendee name, landing page, and origin. Default values are assigned if some optional data is missing.

  4. Queue Invite for Processing: The validated and extracted invite data is then published to AWS SNS for further action, and the requester is redirected to a specified landing page.

What are the key functions that facilitate this process?

Several key functions contribute to the overall operation:

  • lambda_handler(event, *): This is the entry point, extracting the API call event and orchestrating the processing.

  • get_event_invite_from_api(request): Validates the request format and, if valid, calls the queuing function.

  • request_is_valid(request): Performs detailed validation of request parameters, including email format, UID structure, and origin.

  • valid_origins(): Provides a list of accepted request origins (e.g., api, hubspot, mailchimpcta).

  • get_request_values_from(request): Extracts the required and optional parameters from the request, applying default values where needed.

  • get_landing_page_from(request): Specifically extracts and validates the landing page URL.

  • queue_invite_for_processing(request): Prepares the SNS message and publishes it to the NEW_EVENT_INVITE_REQUEST topic, then redirects the user.

Which parameters are required and optional for an event invite request?

The function expects the following parameters:

  • Required:pathParameters["uid"]: A unique identifier for the event.

  • queryStringParameters["email"]: The email address of the organizer.

  • Optional:queryStringParameters["name"]: The attendee's name (defaults to "customer").

  • queryStringParameters["origin"]: The source of the request (defaults to "api").

  • queryStringParameters["landing"]: The URL for redirection (defaults to a predefined value).

How does the system handle errors?

The "Get New Event Invite from API" function incorporates error handling for several scenarios:

  • Invalid Request Parameters: If the email or UID is invalid, an HTTP 400 error is returned, and the invalid request is logged for debugging purposes.

  • SNS Publishing Failures: Failures during the publishing of messages to SNS are logged, but the overall request processing is allowed to continue, indicating a resilient design.

  • Unhandled Exceptions: Any unforeseen errors are logged for investigation, ensuring that sensitive details are not exposed to the user.

What environmental variables are used by this function?

The function utilizes a few environmental variables to configure its behavior:

  • REGION: Specifies the AWS region where the function executes.

  • NEW_EVENT_INVITE_REQUEST: Holds the Amazon Resource Name (ARN) of the SNS topic used for queuing new event invites.

  • LOG_LEVEL: Determines the verbosity level for logging within the function.

What is the overall benefit of this function within the CIS Dashboard?

The "Get New Event Invite from API" function provides a secure, efficient, and scalable method for queuing event invites. By leveraging AWS Lambda and SNS, it enables automated handling of event invite requests, contributing to a robust and high-performing Calendar Invite Server Dashboard.

Chapter 27 Get New Event Data From Sent Calendar Invites from the Rest API
4.45MB ∙ PDF file
Download
This is the Calendar Invite Rest API that fires the Calendar Invite when called via a command. Sometimes they are called in a web page - Click Here to get the Calendar Invite. Or click here in an Embedded Email Provider like MailChimp as the CTA in a "RSVP Button"
Download

Discussion about this episode

User's avatar