resources/assets/js/components/EmailForm.js
/**
  **make request to api to send the email
  **/
make request to api to send the email
make request to api to send the email
handleSubmit(event){
    event.preventDefault()
    console.log(localStorage.getItem("type"))
    var self = this
    var data = {
      displayName:localStorage.getItem("displayName"),
      feedback:this.state.feedback,
      migrationData:this.state.migrationData,
      role:localStorage.getItem("type"),
      sender:{
        email:localStorage.getItem("email"),
        name:localStorage.getItem("displayName")
      }
    }
    axios.post(this.props.url,data).then(function(response){
      return response
    }).then(
      function(result){
        if(result.data.success){
          self.props.success(result.data.msg)
        }else{
          self.props.failed(result.data.msg)
        }
      }
      ).catch(function(error){
        self.props.failed("Sorry an Error has Occurred")
      })
  }
handleSubmit ( event ) { event . preventDefault ( ) console . log ( localStorage . getItem ( "type" ) ) var self = this var data = { displayName : localStorage . getItem ( "displayName" ) , feedback : this . state . feedback , migrationData : this . state . migrationData , role : localStorage . getItem ( "type" ) , sender : { email : localStorage . getItem ( "email" ) , name : localStorage . getItem ( "displayName" ) } } axios . post ( this . props . url , data ) . then ( function ( response ) { return response } ) . then ( function ( result ) { if ( result . data . success ) { self . props . success ( result . data . msg ) } else { self . props . failed ( result . data . msg ) } } ) . catch ( function ( error ) { self . props . failed ( "Sorry an Error has Occurred" ) } ) }
make request to api to send the email
make request to api to send the email