ä»æ¥ãç§ãã¡ã¯å¥ã®èšäºã®ç¿»èš³ãæºåããŸãããä»åã¯AndriyHaydashã«ãããã®ã§ãããã®èšäºã¯ããã©ã°ã€ã³ãä»ããŠã«ã¹ã¿ã æ©èœãäœæããããšã«ã€ããŠã§ãã10æã®CMSãšWordPressã®æ¯èŒã«é¢ããååã®èšäºã¯ããã«ãããŸãã
ãªããžã§ã¯ãæåã§èªã¿ãããã³ãŒããæžãã®ã奜ããªãããã®èšäºã¯ããªãã®ããã§ããç¬èªã®ãã©ã°ã€ã³ãäœæããæ¹æ³ãšã10æã次ã®ãããžã§ã¯ãã«é©ããŠããçç±ãåŠã³ãŸãã
æšå¹Žãç§ã¯æ°ããPHPããŒã¹ã®CMSã«ã€ããŠå°ã調æ»ãè¡ããåªããWordPressã®ä»£æ¿æ段ãæ¢ããŸãããçæ³çã«ã¯ãææ°ã®ã³ãŒãããŒã¹ãåãããªãŒãã³ãœãŒã¹ãœãªã¥ãŒã·ã§ã³ã§ããå¿ èŠããããŸãã
ããããç§ã¯10æã®CMSã«èå³ãæã£ãŠããŸãããç§ã¯ãããè©ŠããŸããããããŠç§ã¯ãããã»ãšãã©ããã«å¥œãã§ããã 10æã¯åªããã³ãŒãæ§é ãæã¡ãç¬èªã®ãã©ã°ã€ã³ãç°¡åã«äœæã§ããŸãã
ãã®èšäºã®ç®çã¯ããã©ãããã©ãŒã ã䜿çšããåã«ããã©ãããã©ãŒã ãšã¯äœãããã©ãããã©ãŒã ããäœãæåŸ ã§ããããç解ããã®ã«åœ¹ç«ã€ããšã§ãã
CMSãã©ãããã©ãŒã ãšããŠ10æãéžã¶çç±ã¯äœã§ããïŒ
ãããžã§ã¯ãã«10æã䜿çšããããšã«ããäž»ãªçç±ã¯ããã€ããããŸãã
Laravelãã¬ãŒã ã¯ãŒã¯ã«æžãããŠããŸã
10æCMSã¯ãææ°ã®Webã¢ããªã±ãŒã·ã§ã³ãæ§ç¯ããããã®æã匷åãªPHPãã¬ãŒã ã¯ãŒã¯ã§ããLaravelã®äžã«æ§ç¯ãããŠããŸãã圌ã¯æé«ã ãšæèšã§ããŸãããã¬ãŒã ã¯ãŒã¯ã¯éåžžã«äœ¿ãããããéåžžã«ç解ããããã§ããããã«ãã«ãŒãã£ã³ã°ïŒã«ãŒãã£ã³ã°ïŒããªããžã§ã¯ããªã¬ãŒã·ã§ãã«ãããã³ã°ïŒORMïŒãæ¿èªããã£ãã·ã³ã°ãªã©ãææ°ã®ãã¬ãŒã ã¯ãŒã¯ã«å¿ èŠãªãã¹ãŠã®æ©èœãåããŠãããModel-View-Controllerã®æŠå¿µã«åŸã£ãŠããããããæ§é ãæäŸããŸãã10æã®CMSã¯Laravelãã¬ãŒã ã¯ãŒã¯ã§èšè¿°ãããŠãããããããããã¹ãŠã®æ©èœããå 貎ãããç¶æ¿ããŸããã
ã¯ãªãŒã³ãªã³ãŒããšããã¥ã¡ã³ã
ä»ã®å€ãã®CMSãšã¯ç°ãªããOctoberã«ã¯ããªããžã§ã¯ãæåã®ãã©ãã€ã ã䜿çšããŠèšè¿°ããããéåžžã«ã¯ãªãŒã³ã§ååã«ææžåãããã³ãŒãããŒã¹ããããŸãã
å€ãè¯ãPHPã®ä»£ããã«ãOctoberã¯ãã³ãã¬ãŒãèšèªãšããŠTwigã䜿çšããéçºè ã®ä»äºã容æã«ããŸããæè¡ææžãããæžãããŠãããã»ãšãã©ã®è³ªåã«ãã°ããçããããšãã§ããŸãã
çŽ æŽãããã³ãã¥ããã£
10æã®ã³ãã¥ããã£ã¯ãŸã å°ããã§ããããã®äººã ã¯èŠªåã§èŠªåã§ããåå ã§ããSlackãã£ãã«ããããéçºè ã¯ã³ãã¥ããã£ãDiscordã«ç§»è¡ããéã®åé¡ã®è§£æ±ºãåãã§ãæäŒãããŸãã
倧èŠæš¡ãªåžå Ž
WordPressãä»ã®CMSãšåæ§ã«ã10æã«ã¯ããŒããšãã©ã°ã€ã³ã®ããŒã±ãããã¬ã€ã¹ããããŸããè¯ãããŒãã®éžæè¢ã¯ããã»ã©å€ããããŸãããã700以äžã®ãã©ã°ã€ã³ããããŸãïŒ2020幎6æã®æç¹ã§ã900以äžã®ãã©ã°ã€ã³ãå ¬éãããçŽ200ã®ããŒãããããŸã-çŽTranslãïŒããããã£ãŠã1ã€ãæ€çŽ¢ããŠã€ã³ã¹ããŒã«ããã ãã§æ©èœãæ¡åŒµã§ããå¯èœæ§ããããŸããã®ãã¡ã®ããã©ã°ã€ã³ã®ç¹åŸŽã¯ã管çé åã«ãããžã§ã¯ãIDãè¿œå ããã ãã§ããã¹ãŠã®ãããžã§ã¯ãéã§ç°¡åã«åæã§ããããšã§ãã
ãã©ã°ã€ã³ãšã³ã³ããŒãã³ã
ãã©ã°ã€ã³ã¯ã10æã®CMSã«æ°æ©èœãè¿œå ããããã®åºç€ã§ãããã©ã°ã€ã³ã¯ãã«ã¹ã¿ã ã³ã³ããŒãã³ããã¢ãã«ã®ç»é²ãããŒã¿ããŒã¹æ§é ã®æŽæ°ããŸãã¯ç¿»èš³ã®è¿œå ãæ åœããè€æ°ã®ãã¡ã€ã«ãšãã£ã¬ã¯ããªã§æ§æã§ããŸãããã©ã°ã€ã³ã¯éåžžãplugins /ãã£ã¬ã¯ããªã®ãããžã§ã¯ãã§äœæãããŸããå€ãã®ãã©ã°ã€ã³ã¯ä»ã®äººã䜿çšã§ããããã«ããŒã±ãããã¬ã€ã¹ã«è¿œå ããããããåãã©ã°ã€ã³ã«ã¯ç¬èªã®åååãå¿ èŠã§ããååã¯éåžžããã©ã°ã€ã³ãäœæããäŒç€ŸãŸãã¯éçºè ã®ååã§å§ãŸããŸãããããã£ãŠãããšãã°ãååãAcmeã§ãBlogãšããåªãããã©ã°ã€ã³ãäœæããå Žåããã©ã°ã€ã³ã¯Acme \ Blogãšããååã«ãªããŸãã
ãã©ã°ã€ã³ãã£ã¬ã¯ããªæ§é ãã©ã®ããã«èŠãããã瀺ããŸãããã
ã芧ã®ãšããã10æã®CMSã«ãã©ã°ã€ã³ãšãã®ãã¹ãŠã®ã³ã³ããŒãã³ããç»é²ããããã®plugin.phpãšãããã¡ã€ã«ããããŸãã
ãã©ã°ã€ã³ãå®è¡ããããã«ãäžèšã®ãã¹ãŠã®ãã£ã¬ã¯ããªãå¿ èŠãªããã§ã¯ãªãããšã«æ³šæããŠãã ããããã©ã°ã€ã³ã¯æ¬¡ã®æ§é ãæã¡ãããã§ãããŸã
æ©èœããŸããå€ãã®å Žåã1ã€ã®ãã©ã°ã€ã³ã¯1ã€ã®æ©èœããè¿œå ããŸãããããšãã°ãTranslateãã©ã°ã€ã³ã¯ããµã€ãã®ã³ã³ãã³ããããŸããŸãªèšèªã«ç¿»èš³ããå€èšèªã®ãŠãŒã¶ãŒãµããŒããæäŸã§ããããã«èšèšãããŠããŸãã
10æCMSã«ã¯ãå¿ èŠãªãã®ãã¹ãŠãèŠã€ããããšãã§ãã倧ããªåžå ŽããããŸãã
Wordpressããã®ä»ã®äžè¬çãªCMSãšã¯ç°ãªããOctoberãã©ã°ã€ã³ã«ã¯ã³ã³ããŒãã³ããå«ããããšãã§ããŸãã 10æã®ããã¥ã¡ã³ãã«ãããšãã³ã³ããŒãã³ãã¯ãä»»æã®ããŒãžãéšåããŸãã¯ã¬ã€ã¢ãŠãã«æ·»ä»ã§ããã«ã¹ã¿ã ã¢ãžã¥ãŒã«ãã§ããããšãã°ããã£ãŒãããã¯ãã©ãŒã ãããã²ãŒã·ã§ã³ãFAQïŒãããã質åãšãã®åçã®ãªã¹ãïŒãå®éãè€æ°ã®ããŒãžã§åå©çšã§ãã1ã€ã®ã¢ãžã¥ãŒã«ã«çµã¿åãããã®ãè«ççã§ãããã¹ãŠã®ãã®ã
ã³ã³ããŒãã³ãã¯ãã©ã°ã€ã³ã®äžéšãšããŠäœæãããcomponents /ãµããã£ã¬ã¯ããªã«ãããŸãã
åã³ã³ããŒãã³ãã«ã¯ãã³ã³ããŒãã³ããå®çŸ©ããcomponentName.phpãªã©ã®PHPãã¡ã€ã«ãšããªãã·ã§ã³ã®ãµããã£ã¬ã¯ããªããããŸããããŒã·ã£ã«çšãã³ã³ããŒãã³ãã®partialsãã©ã«ããŒã«ã¯ãã³ã³ããŒãã³ãèªäœãšåãå°æåã®ååãä»ããå¿ èŠããããŸãã
ã³ã³ããŒãã³ããã©ã®ããã«æ©èœããããç解ããããã«ãã³ã³ããŒãã³ããããã°æçš¿ã®è¡šç€ºãæ åœããŠãããšä»®å®ããŸãããã
namespace Acme\Blog\Components;
class BlogPosts extends \Cms\Classes\ComponentBase
{
public function componentDetails()
{
return [
'name' => 'Blog Posts',
'description' => 'Displays a collection of blog posts.'
];
}
// This array becomes available on the page as {{ component.posts }}
public function posts()
{
return ['First Post', 'Second Post', 'Third Post'];
}
}
ã芧ã®ãšãããã³ã³ããŒãã³ãã«ã¯2ã€ã®äž»èŠãªæ©èœããããŸããæåã®componentDetailsïŒïŒã¯ãWebããŒãžã«ã³ã³ããŒãã³ããè¿œå ããŠäœ¿çšãã管çè ã«ã³ã³ããŒãã³ãã«é¢ããæ å ±ãæäŸããŸãã2çªç®ã®é¢æ°postsïŒïŒã¯ç©ºã®æçš¿ãè¿ãã次ã®ããã«ã³ã³ããŒãã³ãããŒãïŒblogposts / default.htmãã¡ã€ã«ïŒå ã§äœ¿çšã§ããŸãã
url = "/blog"
[blogPosts]
==
{% for post in blogPosts.posts %}
{{ post }}
{% endfor %}
10æã®CMSã«ã³ã³ããŒãã³ããååšããããšãç¥ãããã«ã¯ãregisterComponentsïŒïŒé¢æ°å ã®ã¡ã€ã³ãã©ã°ã€ã³ãã¡ã€ã«ã䜿çšããŠã³ã³ããŒãã³ããç»é²ããå¿ èŠããããŸãã
public function registerComponents()
{
return [
'October\Demo\Components\Todo' => 'demoTodo'
];
}<
ãåãåãããã©ãŒã ãã©ã°ã€ã³ã®äœææ¹æ³
ãã£ãŒãããã¯ãã©ãŒã ãäœæããããã®ãã©ã°ã€ã³ãäœæããŸãããããã©ã®ããã«æ©èœãããã§ãïŒ
- ãã©ãŒã ã«ã¯ãåãå§ãé»åã¡ãŒã«ã¢ãã¬ã¹ãã¡ãã»ãŒãžã®ãã£ãŒã«ããå«ãŸããŸãã
- ããŒã¿ã¯Ajaxã䜿çšããŠãµãŒããŒã«éä¿¡ãããŸãã
- ããŒã¿ãéä¿¡ãããšã管çè ã¯ãŠãŒã¶ãŒãéä¿¡ããã¡ãã»ãŒãžãèšèŒãããé»åã¡ãŒã«ãåä¿¡ããŸãããã®èšäºã§ã¯ã 10æã®CMSã®ã¯ãªãŒã³ã€ã³ã¹ããŒã«ã䜿çšããŸãã
ãã©ã°ã€ã³æ§é ãçæ ããã¿ãŒããã«ã§ã³ãã³ããå®è¡ããŠããã©ã°ã€ã³ã®æ§ç¯ãå§ããŸãããã
php artisan create:plugin progmatiq.contactform
progmatiq.contactformåŒæ°ã«ã¯ãäœæè ã®ååïŒprogmatiqïŒãšãã©ã°ã€ã³ã®ååïŒcontactformïŒãå«ãŸããŠããŸãã
次ã«ãplugin.phpãã¡ã€ã«ãéãã次ã®æ¹æ³ã§ãã©ã°ã€ã³æ å ±ãå€æŽããå¿ èŠããããŸãã
public function pluginDetails()
{
return [
'name' => 'Contact Form',
'description' => 'A simple contact form plug-in',
'author' => 'progmatiq',
'icon' => 'icon-leaf'
];
}
確èªãã䟡å€ã®ããä»ã®ããã€ãã®æ¹æ³ã次ã«ç€ºããŸãã
- registerComponentsïŒïŒ
ããã§ããã©ã°ã€ã³ãæäŸããã³ã³ããŒãã³ãã®é åãå®çŸ©ã§ããŸãã - registerPermissionsïŒïŒ
ã«ã¹ã¿ã æš©éãç»é²ããŠãã¢ããªã±ãŒã·ã§ã³ã®ä»ã®é åã§äœ¿çšã§ããŸãã - registerNavigationïŒïŒã«ã¹ã¿ã URLã¡ãã¥ãŒé
ç®ã管çã¡ãã¥ãŒã«
è¿œå ã§ããŸãã
ContactFormã³ã³ããŒãã³ããäœæããŸãããïŒ
- ãã©ã°ã€ã³ã®ã«ãŒããã£ã¬ã¯ããªã«æ°ããã³ã³ããŒãã³ã/ãã©ã«ããäœæããŸãã
- components /ãã£ã¬ã¯ããªã«contactForm.phpãã¡ã€ã«ãäœæããŸãã
- 次ã®ã³ãŒãã貌ãä»ããŠãã³ã³ããŒãã³ããäœãããŠãããã10æã«äŒããŸãããããè¡ãã«ã¯ãã³ã³ããŒãã³ãå ã«componentDetailsïŒïŒã¡ãœãããäœæããŸãã
<?php
namespace Progmatiq\Contactform\Components;
use Cms\Classes\ComponentBase;
class ContactForm extends ComponentBase
{
public function componentDetails()
{
return [
'name' => 'Contact Form',
'description' => 'A simple contact form'
];
}
}
次ã«ããã©ã°ã€ã³å ã«ã³ã³ããŒãã³ããç»é²ããå¿ èŠããããŸãããããè¡ãã«ã¯ãregisterComponentsïŒïŒã¡ãœãããå€æŽããŸãã
public function registerComponents()
{
return [
'Progmatiq\Contactform\Components\ContactForm' => 'contactForm',
];
}
ãã®é¢æ°ã¯ããã©ã°ã€ã³ãæäŸããã³ã³ããŒãã³ãã®é åãè¿ããŸããã³ã³ããŒãã³ãã¯ã©ã¹ã®å®å šä¿®é£Ÿåããã®ã¡ãœããã®ããŒã§ãããå€ã¯Twigãã³ãã¬ãŒãã§ã³ã³ããŒãã³ããåç §ããããã«äœ¿çšãããšã€ãªã¢ã¹ã§ãã
ã³ã³ããŒãã³ããç»é²ããããæ°ããé£çµ¡å ããŒãžãäœæããŠã³ã³ããŒãã³ããè¿œå ã§ããŸãïŒã¹ãããçªå·ã¯ã¹ã¯ãªãŒã³ã·ã§ããã®å³ãšåãã§ãïŒã
- 管çããã«ã§ãCMSïŒ1ïŒ>ããŒãžïŒ2ïŒã«ç§»åãã+è¿œå ïŒ3ïŒãã¯ãªãã¯ããŸãã
- ããŒãžã«ååãšURLãä»ããŸãïŒ4ïŒã
- ãã¡ã€ã«ã«ååãä»ãïŒ5ïŒãããã©ã«ãã®ã¬ã€ã¢ãŠããéžæããŸãïŒ6ïŒã
æ°ããã³ã³ããŒãã³ããããŒãžã«è¿œå ããŸãããã
- å·ŠåŽã®ã¡ãã¥ãŒïŒ1ïŒã§[ã³ã³ããŒãã³ã]ãã¯ãªãã¯ãããåãåãããã©ãŒã ã³ã³ããŒãã³ããéžæããŸããããïŒ2ïŒãã¯ãªãã¯ãããšãããŒãžã«è¿œå ãããŸãã
- ããŒãžã«ã¿ã€ãã«ãè¿œå ããã³ãŒããé 眮ããTwigãã£ã¬ã¯ãã£ã{ïŒ component'contactForm 'ïŒ }ã䜿çšããŠã³ã³ããŒãã³ããã¬ã³ããªã³ã°ããå¿ èŠããããŸãã
<div class="container">
<h1> Contact </h1>
{% component 'contactForm' %}
</dÑv>
ããã§é£çµ¡å ããŒãžãéããšããé£çµ¡å ããšããããããŒä»¥å€ã¯äœã衚瀺ãããŸããã
åé¡ã¯ããã©ãŒã ã«è¡šç€ºããHTMLããªããšããããšã§ãã
components /ãã©ã«ããŒã«contactform / default.htmãã¡ã€ã«ãäœæããå¿ èŠããããŸãã
ãŸãã次ã®HTMLããã¡ã€ã«ã«è¿œå ããå¿ èŠããããŸãã
<form method="POST"
data-request="onSend"
data-request-validate
data-request-success="this.reset(); alert('Thank you for submitting your inquiry')"
>
<div>
<label for="first_name">First Name</label>
<input type="text" name="first_name" class="form-control">
<p data-validate-for="first_name" class="text-danger"></p>
</div>
<div>
<label for="last_name">Last Name</label>
<input type="text" name="last_name" class="form-control">
<p data-validate-for="last_name" class="text-danger"></p>
</div>
<div>
<label for="email">Email</label>
<input type="text" name="email" class="form-control">
<p data-validate-for="email" class="text-danger"></p>
</div>
<div>
<label for="content">Content</label>
<textarea rows="6" cols="20" name="content" class="form-control"></textarea>
<p data-validate-for="content" class="text-danger"></p>
</div>
<div>
<button type="submit" class="btn btn-primary" data-attach-loading>Send</button>
</div>
</form>
ã»ãšãã©ã®ã³ãŒãã¯éåžžã«åçŽã§ãããã ãã10æã«äœ¿çšã§ããç¹å¥ãªããŒã¿-*å±æ§ããããŸã
ãã¿ã°ã«ã¯3ã€ã®ç¹å¥ãªå±æ§ããããŸãã
data-request="onSend"
ãã®å±æ§ã¯ããã©ãŒã ãAjaxã䜿çšããŠéä¿¡ããããšãã«ãã³ã³ããŒãã³ãïŒæ¬¡ã«äœæããïŒã®onSendé¢æ°ãåŒã³åºãå¿ èŠãããããšã10æã«éç¥ããŸãã
data-request-validate
ãã©ãŒã ãç¡å¹ãªå Žåã«ãµãŒããŒããéä¿¡ããããšã©ãŒã䜿çšããŠãAjaxãä»ãããã©ãŒã æ€èšŒãæå¹ã«ããŸãã
data-request-success="this.reset(); alert('Thank you for submitting your inquiry')"
ãã©ãŒã ãã¯ãªã¢ãããªã¯ãšã¹ããæåããæ€èšŒãŸãã¯ãµãŒããŒãšã©ãŒããªãã£ãå Žåã¯ãã¡ãã»ãŒãžãçºè¡ããŸãã
åå ¥åã«ã¯æ¬¡ã®ãããã¯ããããç¹å®ã®å ¥åã«å¯ŸããŠãµãŒããŒããè¿ãããæ€èšŒãšã©ãŒã衚瀺ããŸãã
<p data-validate-for="content" class="text-danger"></p>
éä¿¡ãã¿ã³ã«ã¯data-attach-loadingå±æ§ãããããµãŒããŒãèŠæ±ãåŠçããŠããéãã¹ãããŒãè¿œå ããŠãã¿ã³ãç¡å¹ã«ããŸããããã¯ãåã®ãªã¯ãšã¹ããåŠçããããŸã§ããŠãŒã¶ãŒããã©ãŒã ãå床éä¿¡ã§ããªãããã«ããããã§ãã
ãããç§ãã¡ã®ããŒãžã®çŸåšã®å€èŠ³ã§ã
ãcontactForm.phpã³ã³ããŒãã³ãã«æ»ãããã©ãŒã ã®éä¿¡ãæ åœããonSendïŒïŒããã³validateïŒïŒãã«ããŒã¡ãœãããäœæããŸãããã
public function onSend()
{
// Get request data
$data = \Input::only([
'first_name',
'last_name',
'email',
'content'
]);
// Validate request
$this->validate($data);
// Send email
$receiver = 'admin@gmail.com';
\Mail::send('progmatiq.contact::contact', $data, function ($message) use ($receiver) {
$message->to($receiver);
});
}
protected function validate(array $data)
{
// Validate request
$rules = [
'first_name' => 'required|min:3|max:255',
'last_name' => 'required|min:3|max:255',
'email' => 'required|email',
'content' => 'required',
];
$validator = \Validator::make($data, $rules);
if ($validator->fails()) {
throw new ValidationException($validator);
}
}
æåã«è¡ãããšã¯ããªã¯ãšã¹ãããããŒã¿ãååŸããvalidateïŒïŒãã«ããŒã¡ãœããã䜿çšããŠæ€èšŒããããšã§ãã䜿çšã§ãããã¹ãŠã®å©çšå¯èœãªæ€èšŒã«ãŒã«ã¯ãããã¥ã¡ã³ãã«èšèŒãããŠããŸããæ€èšŒã倱æããå ŽåãvalidateïŒïŒã¡ãœããã¯ValidationExceptionãã¹ããŒããŸã-ã³ãŒãã®å®è¡ã¯åæ¢ãããµãŒããŒã¯406ã¹ããŒã¿ã¹ã³ãŒããšæ€èšŒå€±æã¡ãã»ãŒãžãçºè¡ããŸãã
æ€èšŒãæåãããšã管çè ã«ã¡ãŒã«ãéä¿¡ããŸãã
泚ïŒç°¡åã«ããããã«ããªã¯ãšã¹ãã®éä¿¡å ã®ã¡ãŒã«ã¯admin@gmail.comã§ãããšæ³å®ããŸãããå¿ ãèªåã®ã¡ãŒã«ã¢ãã¬ã¹ã䜿çšããŠãã ããã
contactForm.phpãã©ã°ã€ã³ã®å®å šãªã³ãŒãã¯æ¬¡ã®ãšããã§ãã
<?php
namespace Progmatiq\Contactform\Components;
use Cms\Classes\ComponentBase;
use October\Rain\Exception\ValidationException;
class ContactForm extends ComponentBase
{
public function componentDetails()
{
return [
'name' => 'Contact Form',
'description' => 'A simple contact form'
];
}
public function onSend()
{
// Get request data
$data = \Input::only([
'first_name',
'last_name',
'email',
'content'
]);
// Validate request
$this->validate($data);
// Send email
$receiver = 'admin@gmail.com';
\Mail::send('progmatiq.contact::contact', $data, function ($message) use ($receiver) {
$message->to($receiver);
});
}
protected function validate(array $data)
{
// Validate request
$rules = [
'first_name' => 'required|min:3|max:255',
'last_name' => 'required|min:3|max:255',
'email' => 'required|email',
'content' => 'required',
];
$validator = \Validator::make($data, $rules);
if ($validator->fails()) {
throw new ValidationException($validator);
}
}
}
ã芧ã®ãšãããMail :: sendïŒïŒé¢æ°ãåãæåã®åŒæ°ã¯ãã¡ãã»ãŒãžã®æ¬æã«è¡šç€ºãããé»åã¡ãŒã«ãã³ãã¬ãŒãã®ååã§ãã管çããã«ã§äœæããå¿ èŠããããŸãã[èšå®]> [ã¡ãŒã«ãã³ãã¬ãŒã]ã«ç§»åãã[æ°ãããã³ãã¬ãŒã]ãã¿ã³ãã¯ãªãã¯ããŸãã次ã«ãäžã®ç»é¢ã«ç€ºãããã«ãã©ãŒã ã«å ¥åããŸãã
䜿çšããã¡ãŒã«ã®æ¬æã¯æ¬¡ã®ãšããã§ãã
æ°ããé£çµ¡å ã®åãåãããåãåããŸãã
**å**ïŒ
{{first_name}}
***
**å§**ïŒ
{{last_name}}
***
**ã¡ãŒã«**ïŒ
{{email}}
** *
**ã¡ãã»ãŒãž**ïŒ
{{content}}
***
次ã«ãã¡ãŒã«ãã³ãã¬ãŒããä¿åããŸãã次ã«è¡ãå¿ èŠãããã®ã¯ãé»åã¡ãŒã«ãéä¿¡ããSMTPãµãŒããŒãã»ããã¢ããããããšã§ãã[èšå®]> [ã¡ãŒã«èšå®]ã«
移åãããã¹ãŠã®èšå®ãå ¥åããŸãã ãã¡ãããèšå®ãå ±æããããšã¯ãããŸãããç¬èªã®èšå®ã䜿çšããŠãã ããã ãã®æ®µéã§ããã£ãŒãããã¯ãã©ãŒã ã³ã³ããŒãã³ãã®ãã¹ããéå§ããæºåãæŽããŸããã ãŸãã[ã³ã³ãã³ã]ãã£ãŒã«ãã空çœã®ãŸãŸã«ããŠãç¡å¹ãªé»åã¡ãŒã«ã¢ãã¬ã¹ãå ¥åãããšãã«ãæ€èšŒãæ©èœããŠãããã©ããããã¹ãããŸããããæ€èšŒã¯ æåŸ ã©ããã«æ©èœããŸãã次ã«ãæ£ãã詳现ãå ¥åããŠãã¡ãŒã«ã管çè ã«æ£åžžã«éä¿¡ããããã©ããã確èªããŸãããã admin@gmail.comãåä¿¡ããã¡ãŒã«ã¯æ¬¡ã®ãšããã§ãã
ãã©ãŒã ãæ£åžžã«éä¿¡ãããšã察å¿ããã¡ãã»ãŒãžã衚瀺ãããŸãã
åºå
ãã®èšäºã§ã¯ããã©ã°ã€ã³ãšã³ã³ããŒãã³ããäœã§ãããã調ã¹ã10æã®CMSã§ãããã䜿çšããæ¹æ³ãç解ããŸããã
ããŒãºã«åã£ãæ¢åã®ãã©ã°ã€ã³ãèŠã€ãããªãå Žåã¯ããããžã§ã¯ãçšã«ç¬èªã®ãã©ã°ã€ã³ãäœæããããšãæããªãã§ãã ãããããã¯ããã»ã©é£ããããšã§ã¯ãªãããã€ã§ãå®å šã«å¶åŸ¡ãæŽæ°ãæ¡åŒµããããšãã§ããŸããä»æ¥è¡ã£ããããªåçŽãªé£çµ¡ãã©ãŒã ã®ãã©ã°ã€ã³ãäœæããããšã§ãããåŸã§MailchimpãHubSpotãªã©ã®ä»ã®ãµãŒãã¹ãšçµ±åãããå Žåã«åœ¹ç«ã¡ãŸãã
ãã®èšäºãã圹ã«ç«ãŠã°å¹žãã§ãããäžæãªç¹ãããããŸããããã³ã¡ã³ãæ¬ã§ãæ°è»œã«ãåãåãããã ããã