Google Cloud Professional Cloud Developer — Question 328
You are developing a new ecommerce website for your company. You want customers to receive a customized email notification when they place an order. You need to configure this email service while minimizing deployment effort. What should you do?
Answer options
- A. Create a Cloud Function that is triggered by a create type event in Firestore,
- B. Create an email-sending application hosted on Compute Engine that is invoked by an HTTP request.
- C. Create an email notification channel, and set up an alerting policy that is based on log metrics from a create type event.
- D. Use Pub/Sub to send an email when the orders/ API returns an HTTP response of 200 OK.
Correct answer: A
Explanation
The correct answer is A, as using a Cloud Function allows for a serverless approach that directly responds to events in Firestore with minimal setup required. Option B involves more deployment effort and management overhead by having to maintain a Compute Engine instance. Option C focuses on alerting rather than directly sending emails, which does not meet the requirement. Option D uses Pub/Sub but does not correctly relate to the trigger needed for sending emails upon order placement.