首页 > 解决方案 > 我将如何将电子邮件发送给已创建个人资料的用户?

问题描述

基本上,一旦用户创建了个人资料,他们就会收到一条消息,说明个人资料已创建,并且会发送一封电子邮件,确认已创建的个人资料。这是我到目前为止的一个例子。

    method: 'POST',
    headers: {
        'Accept': 'application/json',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
        first_name: input.first_name.toLowerCase(),
        last_name: input.last_name.toLowerCase(),
        phone_number: input.phone_number.toLowerCase(),
        org: input.org.toLowerCase(), 
        email: input.email.toLowerCase(),
        password: input.password,
        role: input.role
    })
}).then(response => response.json())
    .then(json =>{ //When the responce is a promise you .then the .json() to get the promise value
        if (json){
            dispatch(addUserSuccess());
            toastr.success(
                'Success!',
                'User has been added'
                'E-mail confirmation sent'
            );
        } 
        else{
            dispatch(addUserFailure());
            toastr.error(
                'Failure',
                'Unable to add new user'
            )
        };
    });

};

};

标签: htmlreactjs

解决方案


推荐阅读