begin
-- Insert into profiles table
insert into public.profiles (id, email, full_name)
values (
new.id,
new.email,
new.raw_user_meta_data->>'full_name'
);
-- Asynchronous HTTP POST using pg_net to notify Edge Function
begin
perform net.http_post(
url := 'https://-----.supabase.co/functions/v1/add-to-resend',
headers := jsonb_build_object(
'Content-Type', 'application/json'
),
body := jsonb_build_object(
'email', new.email
)
);
exception when others then
-- Silently ignore any HTTP errors
null;
end;
return new;
end;
begin
-- Insert into profiles table
insert into public.profiles (id, email, full_name)
values (
new.id,
new.email,
new.raw_user_meta_data->>'full_name'
);
-- Asynchronous HTTP POST using pg_net to notify Edge Function
begin
perform net.http_post(
url := 'https://-----.supabase.co/functions/v1/add-to-resend',
headers := jsonb_build_object(
'Content-Type', 'application/json'
),
body := jsonb_build_object(
'email', new.email
)
);
exception when others then
-- Silently ignore any HTTP errors
null;
end;
return new;
end;