1. Refer to the previous URL: https://www.shuijingwanwq.com/2016/07/09/1129/;
2. The implementation for obtaining the mobile registration verification code needs to be compatible with previous client versions that only supported mainland China. Therefore, the country area code ID is allowed to be empty, with a default value of 0, as shown in Figure 1:

3. The validation rule where the country area code ID is allowed to be empty and defaults to 0 is shown in Figure 2:

4. The verification code is kept in the cache for 1800 seconds. Its variable name is the concatenation of the country area code ID and the mobile number to ensure uniqueness, as shown in Figure 3:

5. The processing logic for sending template SMS is basically the same as in the previous URL. If the sending is successful, it calculates the number of sends for today and stores it in the cache to limit the daily sending frequency, as shown in Figure 4:

6. Validation for the number of template SMS sent within a day, limiting the daily quantity to 5 messages, as shown in Figures 5 and 6:


7. To support sending SMS via Yunpian, copy Yunpian from the previous URL to \vendor\yunpian, as shown in Figure 7:

8. Edit \common\config\main.php to define an alias, as shown in Figure 8:
‘aliases’ => [
‘@yunpian’ => ‘@vendor/yunpian’,
],

9. Edit \common\config\params.php for the Yunpian SMS interface configuration, as shown in Figure 9:

10. Search for $GLOBALS[‘setting_config’][‘yunpian’] in \vendor\yunpian and replace it with: Yii::$app->params[‘yunpian’], as shown in Figure 10:
![Search for $GLOBALS['setting_config']['yunpian'] in \vendor\yunpian and replace it with: Yii::$app->params['yunpian']](https://media.shuijingwanwq.com/2016/07/10-4.png)
11. To support sending SMS via Yunpian, copy sms.php from the previous URL to \common\components\Sms.php. This allows the corresponding Yunpian class libraries to be referenced within it, as shown in Figure 11:

12. The international SMS sending test is successful, as shown in Figure 12:

