Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

109
Views
Trying to add a CC or similar to email function

Currently this function emails the person who inputs their email in the text field and the sender is our API ecommerce email. The To: is the person who made the request. My trouble is I can't seem to add possibly a CC: field to also add so we know who made the request. Below is the function, there's more to it that I can provide if needed.

    $('#emailCart').click(function(e) {

    e.preventDefault();
    Swal.fire({
        title: 'Enter Email',
        input: 'text',
        showCancelButton: true,
        confirmButtonText: 'Email Cart',
        preConfirm: (email) => {
            if (email.length === 0 || !emailIsValid(email)) {
                Swal.showValidationMessage('Please enter a valid email address.');
            }
        }
    }).then((result) => {
        if (result.value) {

            $.ajax({
                url: apiUrl + '/cart/email',
                method: 'post',
                headers: {
                    'X-CSRF-TOKEN': csrfToken
                },
                data: {
                    email: result.value
                },
                success: function() {

                    Swal.fire({
                        type: 'success',
                        title: 'Success',
                        text: 'Your cart has been emailed.',
                        timer: 1500
                    });

                },
                error: function() {

                    Swal.fire({
                        type: 'error',
                        title: 'Oops...',
                        text: 'Cart could not be emailed.'
                    })

                }
            });

        }
    });
 });
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!