-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unite contact form and newsletter signup into a single sevrerless fun…
…ction.
- Loading branch information
Showing
4 changed files
with
82 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import logging | ||
|
||
import sentry_sdk | ||
from sentry_sdk.integrations.aws_lambda import AwsLambdaIntegration | ||
from newsletter_sign_up import handle_newsletter_sign_up | ||
from contact_form import handle_contact_form | ||
|
||
|
||
logger = logging.getLogger() | ||
logger.setLevel(logging.INFO) | ||
|
||
|
||
sentry_sdk.init( | ||
dsn="https://[email protected]" | ||
+ "/4506218347954176", | ||
integrations=[AwsLambdaIntegration()], | ||
traces_sample_rate=1.0, | ||
profiles_sample_rate=1.0, | ||
) | ||
|
||
|
||
def lambda_handler(event, context): | ||
logger.info('lambda_handler(): invoked. event={}'.format(event)) | ||
try: | ||
# try to create CRM lead | ||
handle_contact_form(event, context) | ||
except Exception as e: | ||
sentry_sdk.capture_exception(e) | ||
logger.exception('lambda_handler(): create_lead failed') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters