last day (15 days later) » 

10:45
0
Q: Contact us form not sending email if we redirect the page to some other url

Baby in MagentoWe have PWA Venia Storefront [ Reactjs on frontend ] . In Contact us page in our website, user enter all details and enter submit button, two things will happen : We are displaying message : "Your message has been sent" in the same page and user will stay on same page. we are passing those form ...

write your email sending code if it not sent by default.
@AfzalArshad custom code send to email is already written here : pastebin.com/aZpFH2F7 , only thing is if the submit form is in same page, than email will deliver, if we redirect form to some other page, than only email not send
write redirect code after email sending code
@AfzalArshad thanks for showing me the right path. is it possible for you to give me an updated code as i am beginner in reactjs
Do you mean redirect code?
10:45
@AfzalArshad redirect is already working, i just want to send the email after form submit
this task is for a backend developer, you can also search how to send emails in magento2, and you will find plenty of code.
Thankyou so much for helping me
the thing is email will send if user stay on same page
i do not know why email not send if we redirect to another page
i'm not able to see the code from the link you sharred
10:46
here is the link
import React, { Fragment, useEffect, useState } from 'react';
import { FormattedMessage, useIntl } from 'react-intl';
import { shape, string } from 'prop-types';
import { Form } from 'informed';

import { useToasts } from '@magento/peregrine';
import { useContactPage } from '@magento/peregrine/lib/talons/ContactPage';

import { useStyle } from '@magento/venia-ui/lib/classify';
import { isRequired } from '@magento/venia-ui/lib/util/formValidators';


import CmsBlock from '@magento/venia-ui/lib/components/CmsBlock/block';
the thing is when you submit form, the ajax request sent to somewhere where email send code is written. but when you redirect to another page, that ajax request might not be able to send, I guess that's why it is not sending email
I'm a backend developer, react is not in my skillset.
11:03
okay, thats fine, thankyou very much for your support.

last day (15 days later) »