Code Duplication    Length = 19-20 lines in 6 locations

src/Eccube/Service/MailService.php 6 locations

@@ 50-69 (lines=20) @@
47
     * @param $Customer 会員情報
48
     * @param $activateUrl アクティベート用url
49
     */
50
    public function sendCustomerConfirmMail(\Eccube\Entity\Customer $Customer, $activateUrl)
51
    {
52
53
        $body = $this->app->renderView('Mail/entry_confirm.twig', array(
54
            'Customer' => $Customer,
55
            'BaseInfo' => $this->BaseInfo,
56
            'activateUrl' => $activateUrl,
57
        ));
58
59
        $message = \Swift_Message::newInstance()
60
            ->setSubject('[' . $this->BaseInfo->getShopName() . '] 会員登録のご確認')
61
            ->setFrom(array($this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName()))
62
            ->setTo(array($Customer->getEmail()))
63
            ->setBcc($this->BaseInfo->getEmail01())
64
            ->setReplyTo($this->BaseInfo->getEmail03())
65
            ->setReturnPath($this->BaseInfo->getEmail04())
66
            ->setBody($body);
67
68
        $this->app->mail($message);
69
    }
70
71
    /**
72
     * Send customer complete mail.
@@ 76-95 (lines=20) @@
73
     *
74
     * @param $Customer 会員情報
75
     */
76
    public function sendCustomerCompleteMail(\Eccube\Entity\Customer $Customer)
77
    {
78
79
        $body = $this->app->renderView('Mail/entry_complete.twig', array(
80
            'Customer' => $Customer,
81
            'BaseInfo' => $this->BaseInfo,
82
        ));
83
84
        $message = \Swift_Message::newInstance()
85
            ->setSubject('[' . $this->BaseInfo->getShopName() . '] 会員登録が完了しました。')
86
            ->setFrom(array($this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName()))
87
            ->setTo(array($Customer->getEmail()))
88
            ->setBcc($this->BaseInfo->getEmail01())
89
            ->setReplyTo($this->BaseInfo->getEmail03())
90
            ->setReturnPath($this->BaseInfo->getEmail04())
91
            ->setBody($body);
92
93
        $this->app->mail($message);
94
95
    }
96
97
98
@@ 105-124 (lines=20) @@
102
     * @param $Customer 会員情報
103
     * @param $email 会員email
104
     */
105
    public function sendCustomerWithdrawMail(\Eccube\Entity\Customer $Customer, $email)
106
    {
107
108
        $body = $this->app->renderView('Mail/customer_withdraw_mail.twig', array(
109
            'Customer' => $Customer,
110
            'BaseInfo' => $this->BaseInfo,
111
        ));
112
113
        $message = \Swift_Message::newInstance()
114
            ->setSubject('[' . $this->BaseInfo->getShopName() . '] 退会手続きのご完了')
115
            ->setFrom(array($this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName()))
116
            ->setTo(array($email))
117
            ->setBcc($this->BaseInfo->getEmail01())
118
            ->setReplyTo($this->BaseInfo->getEmail03())
119
            ->setReturnPath($this->BaseInfo->getEmail04())
120
            ->setBody($body);
121
122
        $this->app->mail($message);
123
124
    }
125
126
127
    /**
@@ 203-222 (lines=20) @@
200
     * @param $Customer 会員情報
201
     * @param $activateUrl アクティベート用url
202
     */
203
    public function sendAdminCustomerConfirmMail(\Eccube\Entity\Customer $Customer, $activateUrl)
204
    {
205
206
        $body = $this->app->renderView('Mail/entry_confirm.twig', array(
207
            'Customer' => $Customer,
208
            'activateUrl' => $activateUrl,
209
        ));
210
211
        $message = \Swift_Message::newInstance()
212
            ->setSubject('[' . $this->BaseInfo->getShopName() . '] 会員登録のご確認')
213
            ->setFrom(array($this->BaseInfo->getEmail03() => $this->BaseInfo->getShopName()))
214
            ->setTo(array($Customer->getEmail()))
215
            ->setBcc($this->BaseInfo->getEmail01())
216
            ->setReplyTo($this->BaseInfo->getEmail03())
217
            ->setReturnPath($this->BaseInfo->getEmail04())
218
            ->setBody($body);
219
220
        $this->app->mail($message);
221
222
    }
223
224
225
    /**
@@ 258-276 (lines=19) @@
255
     *
256
     * @param $Customer 会員情報
257
     */
258
    public function sendPasswordResetNotificationMail(\Eccube\Entity\Customer $Customer, $reset_url)
259
    {
260
        $body = $this->app->renderView('Mail/forgot_mail.twig', array(
261
            'Customer' => $Customer,
262
            'reset_url' => $reset_url
263
        ));
264
265
        $message = \Swift_Message::newInstance()
266
            ->setSubject('[' . $this->BaseInfo->getShopName() . '] パスワード変更のご確認')
267
            ->setFrom(array($this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName()))
268
            ->setTo(array($Customer->getEmail()))
269
            ->setBcc($this->BaseInfo->getEmail01())
270
            ->setReplyTo($this->BaseInfo->getEmail03())
271
            ->setReturnPath($this->BaseInfo->getEmail04())
272
            ->setBody($body);
273
274
        $this->app->mail($message);
275
276
    }
277
278
    /**
279
     * Send password reset notification mail.
@@ 283-301 (lines=19) @@
280
     *
281
     * @param $Customer 会員情報
282
     */
283
    public function sendPasswordResetCompleteMail(\Eccube\Entity\Customer $Customer, $password)
284
    {
285
        $body = $this->app->renderView('Mail/reset_complete_mail.twig', array(
286
            'Customer' => $Customer,
287
            'password' => $password,
288
        ));
289
290
        $message = \Swift_Message::newInstance()
291
            ->setSubject('[' . $this->BaseInfo->getShopName() . '] パスワード変更のお知らせ')
292
            ->setFrom(array($this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName()))
293
            ->setTo(array($Customer->getEmail()))
294
            ->setBcc($this->BaseInfo->getEmail01())
295
            ->setReplyTo($this->BaseInfo->getEmail03())
296
            ->setReturnPath($this->BaseInfo->getEmail04())
297
            ->setBody($body);
298
299
        $this->app->mail($message);
300
301
    }
302
303
}
304