7417 workflows i can send emails using the email account (#7431)
- update `send-email.workflow-action.ts` so it send email via the google sdk - remove useless `workflow-action.email.ts` - add `send` authorization to google api scopes - update the front workflow email step form to provide a `connectedAccountId` from the available connected accounts - update the permissions of connected accounts: ask users to reconnect when selecting missing send permission 
This commit is contained in:
@ -12,11 +12,17 @@ export const useTriggerGoogleApisOAuth = () => {
|
||||
const [generateTransientToken] = useGenerateTransientTokenMutation();
|
||||
|
||||
const triggerGoogleApisOAuth = useCallback(
|
||||
async (
|
||||
redirectLocation?: AppPath,
|
||||
messageVisibility?: MessageChannelVisibility,
|
||||
calendarVisibility?: CalendarChannelVisibility,
|
||||
) => {
|
||||
async ({
|
||||
redirectLocation,
|
||||
messageVisibility,
|
||||
calendarVisibility,
|
||||
loginHint,
|
||||
}: {
|
||||
redirectLocation?: AppPath | string;
|
||||
messageVisibility?: MessageChannelVisibility;
|
||||
calendarVisibility?: CalendarChannelVisibility;
|
||||
loginHint?: string;
|
||||
} = {}) => {
|
||||
const authServerUrl = REACT_APP_SERVER_BASE_URL;
|
||||
|
||||
const transientToken = await generateTransientToken();
|
||||
@ -38,6 +44,8 @@ export const useTriggerGoogleApisOAuth = () => {
|
||||
? `&messageVisibility=${messageVisibility}`
|
||||
: '';
|
||||
|
||||
params += loginHint ? `&loginHint=${loginHint}` : '';
|
||||
|
||||
window.location.href = `${authServerUrl}/auth/google-apis?${params}`;
|
||||
},
|
||||
[generateTransientToken],
|
||||
|
||||
Reference in New Issue
Block a user