Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

feat: Import email signature from Gmail (#7444)

Jacob Beckermane5f13e4990fd
diff --git a/apps/web/src/features/settings/SignatureSection.tsx b/apps/web/src/features/settings/SignatureSection.tsx
index af22ec1b94..12e9c20299 100644
--- a/apps/web/src/features/settings/SignatureSection.tsx
+++ b/apps/web/src/features/settings/SignatureSection.tsx
@@ -2,7 +2,10 @@ import { toast } from '@core/component/Toast/Toast';
import { isMobile } from '@core/mobile/isMobile';
import { ThrownResultError } from '@core/util/result';
import { useEmailSignature } from '@queries/email/link';
-import { useUpdateEmailSettingsMutation } from '@queries/email/settings';
+import {
+ useImportGmailSignatureMutation,
+ useUpdateEmailSettingsMutation,
+} from '@queries/email/settings';
import { SIGNATURE_IMAGES_UNRESOLVED_CODE } from '@service-email/client';
import type { Link as EmailLink } from '@service-email/generated/schemas';
import { createSignal } from 'solid-js';
@@ -63,6 +66,7 @@ export function SignatureSection(props: { link: EmailLink }) {
const hasContent = () => persisted().length > 0 || (draft()?.length ?? 0) > 0;
const updateSettings = useUpdateEmailSettingsMutation();
+ const importGmailSignature = useImportGmailSignatureMutation();
// Imperative handle to the editor, so Save/Remove sync its content directly
// (the reactive `value` path alone didn't reliably clear the box on Remove).
let editorApi: { setContent: (html: string) => void } | undefined;
@@ -112,6 +116,34 @@ export function SignatureSection(props: { link: EmailLink }) {
);
};
+ // The backend fetches the Gmail signature and saves it, so on success the
+ // editor shows the persisted value and any unsaved draft is discarded.
+ const importFromGmail = () => {
+ setSaveError(null);
+ importGmailSignature.mutate(
+ { linkId: props.link.id },
+ {
+ onSuccess: (result) => {
+ if (result.success) {
+ setDraft(null);
+ editorApi?.setContent(result.settings.signature ?? '');
+ toast.success('Signature imported from Gmail');
+ } else if (result.reason === 'no_signature') {
+ toast.failure('No signature found in Gmail');
+ } else if (result.reason === 'unresolved_images') {
+ setSaveError(
+ "Couldn't import images from your Gmail signature. Add the text here and use the image button to add images."
+ );
+ } else {
+ toast.failure('Failed to import signature. Please try again.');
+ }
+ },
+ onError: () =>
+ toast.failure('Failed to import signature. Please try again.'),
+ }
+ );
+ };
+
const setOnRepliesForwards = (checked: boolean) => {
updateSettings.mutate(
{
@@ -135,6 +167,8 @@ export function SignatureSection(props: { link: EmailLink }) {
}}
onSave={saveSignature}
onClear={removeSignature}
+ onImport={importFromGmail}
+ importing={importGmailSignature.isPending}
dirty={isDirty()}
hasContent={hasContent()}
pending={updateSettings.isPending}
diff --git a/apps/web/src/features/settings/browser-test/fixture.tsx b/apps/web/src/features/settings/browser-test/fixture.tsx
index e568aabfce..3c7d9be798 100644
--- a/apps/web/src/features/settings/browser-test/fixture.tsx
+++ b/apps/web/src/features/settings/browser-test/fixture.tsx
@@ -213,6 +213,7 @@ function FixtureSignature(props: { email: string }) {
const [value, setValue] = createSignal(saved());
const [replies, setReplies] = createSignal(true);
const [status, setStatus] = createSignal('');
+ const [importing, setImporting] = createSignal(false);
let api: { setContent: (html: string) => void } | undefined;
return (
<>
@@ -233,6 +234,18 @@ function FixtureSignature(props: { email: string }) {
api?.setContent('');
setStatus('Signature cleared');
}}
+ onImport={() => {
+ setImporting(true);
+ setTimeout(() => {
+ const imported = `<p><strong>Alex Morgan</strong></p><p>Product Lead · <a href="https://example.com">example.com</a></p>`;
+ setValue(imported);
+ setSaved(imported);
+ api?.setContent(imported);
+ setImporting(false);
+ setStatus('Signature imported from Gmail');
+ }, 600);
+ }}
+ importing={importing()}
dirty={saved() !== value()}
hasContent={!!value()}
pending={false}
diff --git a/apps/web/src/features/settings/components/signature-form.test.tsx b/apps/web/src/features/settings/components/signature-form.test.tsx
new file mode 100644
index 0000000000..94c3f47bb9
--- /dev/null
+++ b/apps/web/src/features/settings/components/signature-form.test.tsx
@@ -0,0 +1,58 @@
+import { cleanup, fireEvent, render, screen } from '@solidjs/testing-library';
+import { afterEach, expect, it, vi } from 'vitest';
+import { SignatureForm } from './signature-form';
+
+afterEach(cleanup);
+
+const baseProps = {
+ email: '[email protected]',
+ value: '',
+ onInput: () => {},
+ onReady: () => {},
+ onSave: () => {},
+ onClear: () => {},
+ dirty: false,
+ hasContent: false,
+ pending: false,
+ replies: false,
+ onRepliesChange: () => {},
+};
+
+it('offers Gmail import on desktop and locks the form while importing', () => {
+ const onImport = vi.fn();
+ const { unmount } = render(() => (
+ <SignatureForm {...baseProps} mobile={false} onImport={onImport} />
+ ));
+ fireEvent.click(screen.getByRole('button', { name: 'Import from Gmail' }));
+ expect(onImport).toHaveBeenCalledOnce();
+ unmount();
+
+ render(() => (
+ <SignatureForm
+ {...baseProps}
+ mobile={false}
+ hasContent
+ dirty
+ onImport={onImport}
+ importing
+ />
+ ));
+ for (const name of ['Importing…', 'Clear signature', 'Save signature'])
+ expect(
+ (screen.getByRole('button', { name }) as HTMLButtonElement).disabled
+ ).toBe(true);
+});
+
+it('hides Gmail import on mobile or without a handler', () => {
+ const { unmount } = render(() => (
+ <SignatureForm {...baseProps} mobile onImport={() => {}} />
+ ));
+ expect(
+ screen.queryByRole('button', { name: 'Import from Gmail' })
+ ).toBeNull();
+ unmount();
+ render(() => <SignatureForm {...baseProps} mobile={false} />);
+ expect(
+ screen.queryByRole('button', { name: 'Import from Gmail' })
+ ).toBeNull();
+});
diff --git a/apps/web/src/features/settings/components/signature-form.tsx b/apps/web/src/features/settings/components/signature-form.tsx
index 14e4f79603..e55bc79714 100644
--- a/apps/web/src/features/settings/components/signature-form.tsx
+++ b/apps/web/src/features/settings/components/signature-form.tsx
@@ -1,3 +1,4 @@
+import DownloadIcon from '@phosphor-icons/core/regular/download-simple.svg?component-solid';
import SignatureIcon from '@phosphor-icons/core/regular/signature.svg?component-solid';
import { ToggleSwitch } from '@ui';
import { lazy, Show, Suspense } from 'solid-js';
@@ -13,6 +14,9 @@ export function SignatureForm(props: {
onReady: (api: { setContent: (html: string) => void }) => void;
onSave: () => void;
onClear: () => void;
+ /** Replaces the signature with the one set in Gmail. Omit to hide. */
+ onImport?: () => void;
+ importing?: boolean;
dirty: boolean;
hasContent: boolean;
pending: boolean;
@@ -23,11 +27,28 @@ export function SignatureForm(props: {
}) {
return (
<SettingsSurface class="@container/signature flex flex-col gap-4 rounded-2xl border border-edge-muted p-4">
- <div>
- <h3 class="text-base font-medium break-all">{props.email}</h3>
- <p class="mt-1 text-sm text-ink-muted">
- Automatically added to new emails from this account.
- </p>
+ <div class="flex items-start justify-between gap-3">
+ <div class="min-w-0">
+ <h3 class="text-base font-medium break-all">{props.email}</h3>
+ <p class="mt-1 text-sm text-ink-muted">
+ Automatically added to new emails from this account.
+ </p>
+ </div>
+ <Show when={!props.mobile && props.onImport}>
+ {(onImport) => (
+ <Button
+ class="shrink-0"
+ variant="ghost"
+ size="md"
+ depth={3}
+ disabled={props.pending || props.importing}
+ onClick={() => onImport()()}
+ >
+ <DownloadIcon class="size-4" />
+ {props.importing ? 'Importing…' : 'Import from Gmail'}
+ </Button>
+ )}
+ </Show>
</div>
{/* Editing (Quill) is desktop-only; on mobile the section still offers
the replies/forwards toggle and Remove, with a pointer to desktop. */}
@@ -50,7 +71,7 @@ export function SignatureForm(props: {
<SignatureEditor
label={`Signature for ${props.email}`}
value={props.value}
- disabled={props.pending}
+ disabled={props.pending || props.importing}
onInput={props.onInput}
onReady={props.onReady}
/>
@@ -74,7 +95,7 @@ export function SignatureForm(props: {
variant="outline"
size="md"
depth={3}
- disabled={!props.hasContent || props.pending}
+ disabled={!props.hasContent || props.pending || props.importing}
onClick={props.onClear}
>
Clear signature
@@ -84,7 +105,7 @@ export function SignatureForm(props: {
variant="cta"
size="md"
depth={3}
- disabled={!props.dirty || props.pending}
+ disabled={!props.dirty || props.pending || props.importing}
onClick={props.onSave}
>
{props.pending ? 'Saving…' : 'Save signature'}
diff --git a/apps/web/src/lib/queries/email/settings.ts b/apps/web/src/lib/queries/email/settings.ts
index 42c42e6d14..b426fc7eb6 100644
--- a/apps/web/src/lib/queries/email/settings.ts
+++ b/apps/web/src/lib/queries/email/settings.ts
@@ -1,7 +1,10 @@
import { throwOnErr } from '@core/util/result';
import { Telemetry } from '@macro-inc/observability';
import { queryClient } from '@queries/client';
-import { emailClient } from '@service-email/client';
+import {
+ emailClient,
+ SIGNATURE_IMAGES_UNRESOLVED_CODE,
+} from '@service-email/client';
import type {
ListLinksResponse,
PatchSettingsResponse,
@@ -82,3 +85,85 @@ export function useUpdateEmailSettingsMutation(
),
}));
}
+
+type ImportGmailSignatureVars = { linkId: string };
+
+export type ImportGmailSignatureResult =
+ | { success: true; settings: Settings }
+ | {
+ success: false;
+ reason: 'no_signature' | 'unresolved_images' | 'error';
+ };
+
+type ImportGmailSignatureCallbacks = MutationCallbacks<
+ ImportGmailSignatureResult,
+ Error,
+ ImportGmailSignatureVars
+>;
+
+/**
+ * Imports the email signature from Gmail for the specified inbox. The backend
+ * fetches the signature from the Gmail Settings API and saves it to the user's
+ * settings. The cached settings are updated on success.
+ */
+export function useImportGmailSignatureMutation(
+ callbacks?: ImportGmailSignatureCallbacks
+) {
+ const toHeaderLinkId = useNonPrimaryEmailLinkIdHeader();
+ return useMutation(() => ({
+ mutationFn: async ({
+ linkId,
+ }: ImportGmailSignatureVars): Promise<ImportGmailSignatureResult> => {
+ const result = await emailClient.importGmailSignature(
+ toHeaderLinkId(linkId)
+ );
+ return result.match(
+ (response) => ({ success: true, settings: response.settings }),
+ (errors) => {
+ const has = (code: string) => errors.some((e) => e.code === code);
+ if (has('NO_SIGNATURE_FOUND'))
+ return { success: false, reason: 'no_signature' };
+ if (has(SIGNATURE_IMAGES_UNRESOLVED_CODE))
+ return { success: false, reason: 'unresolved_images' };
+ return { success: false, reason: 'error' };
+ }
+ );
+ },
+
+ ...withCallbacks<
+ ImportGmailSignatureResult,
+ Error,
+ ImportGmailSignatureVars
+ >(
+ {
+ onSuccess: async (result, { linkId }) => {
+ if (!result.success) return;
+ queryClient.setQueryData<ListLinksResponse>(
+ emailKeys.links.queryKey,
+ (old) =>
+ old
+ ? {
+ ...old,
+ links: old.links.map((link) => {
+ if (link.id !== linkId) return link;
+ return {
+ ...link,
+ settings: { ...link.settings, ...result.settings },
+ };
+ }),
+ }
+ : old
+ );
+ try {
+ await refreshMailAccounts();
+ } catch (error) {
+ Telemetry.error(
+ error instanceof Error ? error : new Error(String(error))
+ );
+ }
+ },
+ },
+ callbacks
+ ),
+ }));
+}
diff --git a/apps/web/src/lib/service-clients/service-email/client.ts b/apps/web/src/lib/service-clients/service-email/client.ts
index 1b91978861..877ced3d6b 100644
--- a/apps/web/src/lib/service-clients/service-email/client.ts
+++ b/apps/web/src/lib/service-clients/service-email/client.ts
@@ -675,4 +675,28 @@ export const emailClient = {
}
);
},
+
+ async importGmailSignature(linkId?: string) {
+ return fetchWithToken<
+ PatchSettingsResponse,
+ 'NO_SIGNATURE_FOUND' | typeof SIGNATURE_IMAGES_UNRESOLVED_CODE
+ >(`${emailHost}/email/settings/import-signature`, {
+ method: 'POST',
+ headers: emailLinkHeaders(linkId),
+ errorResponseHandler: async (response) => {
+ if (response.status === 404) {
+ return { code: 'NO_SIGNATURE_FOUND' as const, message: '' };
+ }
+ // Same 422 contract as patchSettings: Gmail images that couldn't be
+ // rehosted, so nothing was saved.
+ if (response.status === 422) {
+ return { code: SIGNATURE_IMAGES_UNRESOLVED_CODE, message: '' };
+ }
+ return {
+ code: 'HTTP_ERROR' as const,
+ message: `HTTP error! status: ${response.status}`,
+ };
+ },
+ });
+ },
};
diff --git a/crates/gmail_client/src/lib.rs b/crates/gmail_client/src/lib.rs
index 2085bcd93c..eb6593da22 100644
--- a/crates/gmail_client/src/lib.rs
+++ b/crates/gmail_client/src/lib.rs
@@ -7,6 +7,7 @@ pub(crate) mod history;
pub(crate) mod labels;
pub(crate) mod messages;
pub(crate) mod profile;
+pub(crate) mod send_as;
pub(crate) mod threads;
pub(crate) mod watch;
@@ -357,4 +358,13 @@ impl GmailClient {
) -> Result<(), GmailApiHttpError> {
filters::delete_filter(self, access_token, filter_id).await
}
+
+ /// Lists all sendAs aliases for the user, including their signatures.
+ #[tracing::instrument(skip(self, access_token), err)]
+ pub async fn list_send_as(
+ &self,
+ access_token: &str,
+ ) -> Result<models_email::gmail::ListSendAsResponse, GmailApiHttpError> {
+ send_as::list_send_as(self, access_token).await
+ }
}
diff --git a/crates/gmail_client/src/send_as.rs b/crates/gmail_client/src/send_as.rs
new file mode 100644
index 0000000000..d8cd62c6e3
--- /dev/null
+++ b/crates/gmail_client/src/send_as.rs
@@ -0,0 +1,23 @@
+use crate::error::{decode_json_response, unsuccessful_response};
+use crate::{GmailApiHttpError, GmailClient};
+use models_email::gmail::ListSendAsResponse;
+
+#[tracing::instrument(skip(client, access_token), err)]
+pub(crate) async fn list_send_as(
+ client: &GmailClient,
+ access_token: &str,
+) -> Result<ListSendAsResponse, GmailApiHttpError> {
+ let response = client
+ .inner
+ .get(format!("{}/users/me/settings/sendAs", client.base_url))
+ .bearer_auth(access_token)
+ .send()
+ .await
+ .map_err(GmailApiHttpError::transport)?;
+
+ if !response.status().is_success() {
+ return Err(unsuccessful_response(response).await);
+ }
+
+ decode_json_response(response).await
+}
diff --git a/crates/models_email/src/gmail.rs b/crates/models_email/src/gmail.rs
index e04b29684f..041a877a0f 100644
--- a/crates/models_email/src/gmail.rs
+++ b/crates/models_email/src/gmail.rs
@@ -241,3 +241,21 @@ pub struct GmailUserProfile {
pub threads_total: i32,
pub history_id: String,
}
+
+/// Response from Gmail users.settings.sendAs.list API
+#[derive(Debug, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub struct ListSendAsResponse {
+ pub send_as: Option<Vec<SendAsAlias>>,
+}
+
+/// A single sendAs alias from Gmail settings
+#[derive(Debug, Deserialize, Clone)]
+#[serde(rename_all = "camelCase")]
+pub struct SendAsAlias {
+ pub send_as_email: String,
+ pub display_name: Option<String>,
+ pub signature: Option<String>,
+ pub is_primary: Option<bool>,
+ pub is_default: Option<bool>,
+}
diff --git a/docs/AGENT_GUIDE/surfaces.md b/docs/AGENT_GUIDE/surfaces.md
index 0b1c5e60b6..6e2fc650c9 100644
--- a/docs/AGENT_GUIDE/surfaces.md
+++ b/docs/AGENT_GUIDE/surfaces.md
@@ -1895,7 +1895,10 @@ Open **Settings → Email → Signatures**. Each owned inbox has a visible edito
there is no expand/collapse control. Format the text, add links or images, and
choose **Save signature**. **Clear signature** removes only the signature, while
**Remove inbox** in Accounts uses the existing inbox removal confirmation.
-**Add to replies & forwards** saves that preference immediately. Unsaved drafts
+**Add to replies & forwards** saves that preference immediately. On desktop,
+**Import from Gmail** in each inbox's header fetches that account's Gmail
+signature and saves it right away, replacing any unsaved draft; a toast reports
+when Gmail has no signature. Unsaved drafts
survive switching settings pages. On phones, signature editing remains desktop-only;
the replies/forwards toggle and clear action are available.
Email accounts can also be managed from **Integrations**. Its **Email settings**
diff --git a/services/email_service/src/api/email/settings.rs b/services/email_service/src/api/email/settings.rs
index 85d233e34d..a142cfe10c 100644
--- a/services/email_service/src/api/email/settings.rs
+++ b/services/email_service/src/api/email/settings.rs
@@ -1,13 +1,16 @@
use crate::api::context::ApiContext;
+use crate::api::email::settings::import_signature::import_signature_handler;
use crate::api::email::settings::patch::patch_settings_handler;
use axum::Router;
-use axum::routing::patch;
+use axum::routing::{patch, post};
+pub(crate) mod import_signature;
pub(crate) mod patch;
pub fn router(state: ApiContext) -> Router<ApiContext> {
Router::new()
.route("/", patch(patch_settings_handler))
+ .route("/import-signature", post(import_signature_handler))
.layer(axum::middleware::from_fn_with_state(
state.clone(),
crate::api::middleware::link::attach_link_context,
diff --git a/services/email_service/src/api/email/settings/import_signature.rs b/services/email_service/src/api/email/settings/import_signature.rs
new file mode 100644
index 0000000000..082a4472ba
--- /dev/null
+++ b/services/email_service/src/api/email/settings/import_signature.rs
@@ -0,0 +1,139 @@
+use crate::api::context::ApiContext;
+use crate::api::email::settings::patch::UnresolvedSignatureImagesError;
+use axum::extract::State;
+use axum::http::StatusCode;
+use axum::response::{IntoResponse, Response};
+use axum::{Extension, Json};
+use email_api_client::domain::models::{EmailApiError, TokenFreshness};
+use email_service::util::process_pre_insert::sfs_map;
+use email_utils::sanitize_html_fragment;
+use model::response::ErrorResponse;
+use models_email::service::link::Link;
+use models_email::{api, service};
+use strum_macros::AsRefStr;
+use thiserror::Error;
+use utoipa::ToSchema;
+
+#[derive(Debug, Error, AsRefStr)]
+pub enum ImportSignatureError {
+ #[error("No signature found in Gmail")]
+ NoSignatureFound,
+ #[error("Failed to fetch Gmail signature")]
+ GmailApiError(#[from] gmail_client::GmailApiHttpError),
+ #[error("Failed to get Gmail access token")]
+ TokenError(#[from] EmailApiError),
+ #[error("Failed to update settings")]
+ DatabaseError(#[from] anyhow::Error),
+ /// At least one Gmail signature image couldn't be fetched and would render
+ /// broken for recipients, so nothing is saved (same rule as `patch.rs`).
+ #[error("{0} signature image(s) could not be loaded")]
+ UnresolvedSignatureImages(u32),
+}
+
+impl IntoResponse for ImportSignatureError {
+ fn into_response(self) -> Response {
+ match self {
+ ImportSignatureError::NoSignatureFound => {
+ (StatusCode::NOT_FOUND, self.to_string()).into_response()
+ }
+ ImportSignatureError::GmailApiError(_) | ImportSignatureError::TokenError(_) => {
+ (StatusCode::BAD_GATEWAY, self.to_string()).into_response()
+ }
+ ImportSignatureError::DatabaseError(_) => {
+ (StatusCode::INTERNAL_SERVER_ERROR, self.to_string()).into_response()
+ }
+ ImportSignatureError::UnresolvedSignatureImages(count) => (
+ StatusCode::UNPROCESSABLE_ENTITY,
+ Json(UnresolvedSignatureImagesError {
+ unresolved_image_count: count,
+ }),
+ )
+ .into_response(),
+ }
+ }
+}
+
+#[derive(Debug, serde::Serialize, serde::Deserialize, ToSchema)]
+pub struct ImportSignatureResponse {
+ pub settings: api::settings::Settings,
+}
+
+/// Import the user's email signature from Gmail.
+#[utoipa::path(
+ post,
+ tag = "Settings",
+ path = "/email/settings/import-signature",
+ operation_id = "import_signature",
+ responses(
+ (status = 200, body = ImportSignatureResponse),
+ (status = 400, body = ErrorResponse),
+ (status = 401, body = ErrorResponse),
+ (status = 404, description = "No signature found in Gmail"),
+ (status = 422, body = UnresolvedSignatureImagesError),
+ (status = 500, body = ErrorResponse),
+ (status = 502, description = "Failed to communicate with Gmail"),
+ )
+)]
+#[tracing::instrument(skip(ctx))]
+pub async fn import_signature_handler(
+ State(ctx): State<ApiContext>,
+ link: Extension<Link>,
+) -> Result<Json<ImportSignatureResponse>, ImportSignatureError> {
+ let access_token = ctx
+ .email_api
+ .get_access_token(link.id, TokenFreshness::Fresh)
+ .await?;
+
+ let send_as_response = ctx
+ .gmail_client
+ .list_send_as(access_token.expose_secret())
+ .await?;
+
+ let aliases = send_as_response.send_as.unwrap_or_default();
+
+ // Prefer the alias for this inbox's own address; fall back to the primary.
+ let email_address = link.email_address.0.as_ref();
+ let alias = aliases
+ .iter()
+ .find(|alias| alias.send_as_email.eq_ignore_ascii_case(email_address))
+ .or_else(|| aliases.iter().find(|alias| alias.is_primary == Some(true)));
+
+ let signature = alias
+ .and_then(|alias| alias.signature.clone())
+ .filter(|sig| !sig.trim().is_empty())
+ .ok_or(ImportSignatureError::NoSignatureFound)?;
+
+ let mut sanitized_signature = sanitize_html_fragment(&signature);
+
+ // Move Gmail-hosted images onto SFS so they render for recipients, matching
+ // `patch_settings_handler`. A rehost *error* never blocks the import.
+ match sfs_map::rehost_html_images(&ctx.db, &ctx.sfs_client, &sanitized_signature).await {
+ Ok((rehosted, unresolved)) => {
+ if unresolved > 0 {
+ return Err(ImportSignatureError::UnresolvedSignatureImages(
+ unresolved as u32,
+ ));
+ }
+ sanitized_signature = rehosted;
+ }
+ Err(e) => {
+ tracing::warn!(error = ?e, "signature image rehost failed; importing signature unchanged");
+ }
+ }
+
+ let patch = service::settings::SettingsPatch::new(
+ api::settings::Settings {
+ signature: Some(sanitized_signature),
+ signature_on_replies_forwards: None,
+ },
+ link.id,
+ );
+
+ let updated_settings = email_db_client::settings::patch_settings(&ctx.db, patch).await?;
+
+ let response_settings = api::settings::Settings::from(updated_settings);
+
+ Ok(Json(ImportSignatureResponse {
+ settings: response_settings,
+ }))
+}