0
I have a form of scheduling visits, when the user makes his scheduling and confirms is triggered an email to the same one with scheduling information. I wonder if anyone has ever integrated an SMS API with PHP.
Example:
My Send API uses the following URL to send the SMS
How do I include this API as soon as it triggers the already confirmation email to the user about scheduling.
Data input form code part
<div id="wizard-frame-3" class="wizard-frame" style="display:none;">
<div class="frame-container">
<h3 class="frame-title"><?php echo $this->lang->line('step_three_title'); ?></h3>
<div class="frame-content row">
<div class="col-xs-12 col-sm-6">
<div class="form-group">
<label for="first-name" class="control-label"><?php echo $this->lang->line('first_name'); ?> *</label>
<input type="text" id="first-name" class="required form-control" maxlength="100" />
</div>
<div class="form-group">
<label for="last-name" class="control-label"><?php echo $this->lang->line('last_name'); ?> *</label>
<input type="text" id="last-name" class="required form-control" maxlength="250" />
</div>
<div class="form-group">
<label for="email" class="control-label"><?php echo $this->lang->line('email'); ?> *</label>
<input type="text" id="email" class="required form-control" maxlength="250" />
</div>
<div class="form-group">
<label for="phone-number" class="control-label"><?php echo $this->lang->line('phone_number'); ?> *</label>
<input type="text" id="phone-number" class="required form-control" maxlength="60" />
</div>
</div>
<div class="col-xs-12 col-sm-6">
<div class="form-group">
<label for="address" class="control-label"><?php echo $this->lang->line('address'); ?></label>
<input type="text" id="address" class="form-control" maxlength="250" />
</div>
<div class="form-group">
<label for="city" class="control-label"><?php echo $this->lang->line('city'); ?></label>
<input type="text" id="city" class="form-control" maxlength="120" />
</div>
<div class="form-group">
<label for="zip-code" class="control-label"><?php echo $this->lang->line('zip_code'); ?></label>
<input type="text" id="zip-code" class="form-control" maxlength="120" />
</div>
<div class="form-group">
<label for="notes" class="control-label"><?php echo $this->lang->line('notes'); ?></label>
<textarea id="notes" maxlength="500" class="form-control" rows="3"></textarea>
</div>
</div>
<em id="form-message" class="text-danger"><?php echo $this->lang->line('fields_are_required'); ?></em>
</div>
</div>
<div class="command-buttons">
<button type="button" id="button-back-3" class="btn button-back btn-default"
data-step_index="3"><span class="glyphicon glyphicon-backward"></span>
<?php echo $this->lang->line('back'); ?>
</button>
<button type="button" id="button-next-3" class="btn button-next btn-primary"
data-step_index="3">
<?php echo $this->lang->line('next'); ?>
<span class="glyphicon glyphicon-forward"></span>
</button>
</div>
</div>
<?php
// ------------------------------------------------------
// APPOINTMENT DATA CONFIRMATION
// ------------------------------------------------------ ?>
<div id="wizard-frame-4" class="wizard-frame" style="display:none;">
<div class="frame-container">
<h3 class="frame-title"><?php echo $this->lang->line('step_four_title'); ?></h3>
<div class="frame-content row">
<div id="appointment-details" class="col-xs-12 col-sm-6"></div>
<div id="customer-details" class="col-xs-12 col-sm-6"></div>
</div>
<?php if ($this->settings_model->get_setting('require_captcha') === '1'): ?>
<div class="frame-content row">
<div class="col-sm-12 col-md-6">
<h4 class="captcha-title">
CAPTCHA
<small class="glyphicon glyphicon-refresh"></small>
</h4>
<img class="captcha-image" src="<?php echo site_url('captcha'); ?>">
<input class="captcha-text" type="text" value="" />
<span id="captcha-hint" class="help-block" style="opacity:0"> </span>
</div>
</div>
<?php endif; ?>
</div>
<div class="command-buttons">
<button type="button" id="button-back-4" class="btn button-back btn-default"
data-step_index="4">
<span class="glyphicon glyphicon-backward"></span>
<?php echo $this->lang->line('back'); ?>
</button>
<form id="book-appointment-form" style="display:inline-block" method="post">
<button id="book-appointment-submit" type="button" class="btn btn-success">
<span class="glyphicon glyphicon-ok"></span>
<?php
echo (!$manage_mode) ? $this->lang->line('confirm')
: $this->lang->line('update');
?>
</button>
<input type="hidden" name="csrfToken" />
<input type="hidden" name="post_data" />
</form>
</div>
</div>
File sending the email
<title>Appointment Details</title>
<div id="content" style="padding: 10px 15px;">
<h2>$email_title</h2>
<p>$email_message</p>
<h2>Appointment Details</h2>
<table id="appointment-details">
<tr>
<td class="label" style="padding: 3px;font-weight: bold;">Service</td>
<td style="padding: 3px;">$appointment_service</td>
</tr>
<tr>
<td class="label" style="padding: 3px;font-weight: bold;">Provider</td>
<td style="padding: 3px;">$appointment_provider</td>
</tr>
<tr>
<td class="label" style="padding: 3px;font-weight: bold;">Start</td>
<td style="padding: 3px;">$appointment_start_date</td>
</tr>
<tr>
<td class="label" style="padding: 3px;font-weight: bold;">End</td>
<td style="padding: 3px;">$appointment_end_date</td>
</tr>
</table>
<h2>Customer Details</h2>
<table id="customer-details">
<tr>
<td class="label" style="padding: 3px;font-weight: bold;">Name</td>
<td style="padding: 3px;">$customer_name</td>
</tr>
<tr>
<td class="label" style="padding: 3px;font-weight: bold;">Email</td>
<td style="padding: 3px;">$customer_email</td>
</tr>
<tr>
<td class="label" style="padding: 3px;font-weight: bold;">Phone</td>
<td style="padding: 3px;">$customer_phone</td>
</tr>
<tr>
<td class="label" style="padding: 3px;font-weight: bold;">Address</td>
<td style="padding: 3px;">$customer_address</td>
</tr>
</table>
<h2>Appointment Link</h2>
<a href="$appointment_link" style="width: 600px;">$appointment_link</a>
</div>
</div>
Alex I have an integrated text system with email, I was only doubtful you want to send the text after sending the email?
– Diego Braga
Diego, I have a scheduling form that already works, as soon as the user performs a scheduling automatically already triggers to his email the scheduling information that he did OK? Dai I have an SMS sending system that has an API that can be integrated into this system of scheduling visits. wanted to make sure that as soon as he confirmed the appointment and sent the confirmation email he would send a text to the number of the person who was already registered in the form. managed to understand?
– Alex Sousa
OK I’ll post the answer.
– Diego Braga
Diego if you want, put part of my code here.
– Alex Sousa
place, which I try to adapt.
– Diego Braga
I updated the code on the question already, if you need anything else I pick up here..
– Alex Sousa
vc send the email with Function mail(); correct?
– Diego Braga
That’s right, with mail();
– Alex Sousa