Thứ Sáu, 27 tháng 9, 2019

Nội dung cần nhớ - Dự án có Redux

disthpath redux
{
type: 'GET_SERVICE_TICKET',
data: {
CounterNumber: 12,
TicketNumber: 1200
}
}

2 nhận xét:

  1. {
    type: 'GET_SERVICE_TICKET',
    data: {
    CounterNumber: 13,
    TicketNumber: 1200
    }
    }

    Trả lờiXóa
  2. HÀM React gửi email tự động
    ------------------------------
    handleSentEmail = (e) => {
    e.preventDefault()
    if (!this.validateEmail()){
    return
    }
    const { company, firstname, lastname, email, content } = this.state
    var templateParams = {
    to_name: 'WEE_DIGITAL',
    message_html: content,
    representative_name: firstname + ' ' + lastname,
    from_name: company,
    reply_to: email,
    }
    window.emailjs.send(
    'gmail',
    'template_fJd1hGHL',
    templateParams,
    'user_ssva2y8HfbM0YDUb1uWHT',
    )
    .then(responce => {
    toastr.success('Email sent successfull')
    console.log('Email successfully sent!',responce)
    })
    .catch(err => {
    toastr.error('Email sent failed')
    console.error('Oh well, you failed. Here some thoughts on the error that occured:', err)
    })
    setTimeout(() => {
    this.props.showPopupContact()
    this.handleCancel()
    }, 1000);
    }

    Trả lờiXóa