sendgrid_api/email_cname_records.rs
1use crate::Client;
2use crate::ClientResult;
3
4pub struct EmailCnameRecords {
5 pub client: Client,
6}
7
8impl EmailCnameRecords {
9 #[doc(hidden)]
10 pub fn new(client: Client) -> Self {
11 EmailCnameRecords { client }
12 }
13
14 /**
15 * Email DNS records to a co-worker.
16 *
17 * This function performs a `POST` to the `/whitelabel/dns/email` endpoint.
18 *
19 * **This endpoint is used to share DNS records with a colleagues**
20 *
21 * Use this endpoint to send SendGrid-generated DNS record information to a co-worker so they can enter it into your DNS provider to validate your domain and link branding.
22 *
23 * What type of records are sent will depend on whether you have chosen Automated Security or not. When using Automated Security, SendGrid provides you with three CNAME records. If you turn Automated Security off, you are instead given TXT and MX records.
24 *
25 * If you pass a `link_id` to this endpoint, the generated email will supply the DNS records necessary to complete [Link Branding](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) setup. If you pass a `domain_id` to this endpoint, the generated email will supply the DNS records needed to complete [Domain Authentication](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Passing both IDs will generate an email with the records needed to complete both setup steps.
26 *
27 * You can retrieve all your domain IDs from the returned `id` fields for each domain using the "List all authenticated domains" endpoint. You can retrieve all of your link IDs using the "Retrieve all branded links" endpoint.
28 */
29 pub async fn post_whitelabel_dns_email(
30 &self,
31 body: &crate::types::PostWhitelabelDnsEmailRequest,
32 ) -> ClientResult<crate::Response<()>> {
33 let url = self.client.url("/whitelabel/dns/email", None);
34 self.client
35 .post(
36 &url,
37 crate::Message {
38 body: Some(reqwest::Body::from(serde_json::to_vec(body)?)),
39 content_type: Some("application/json".to_string()),
40 },
41 )
42 .await
43 }
44}