Issues (114)

Services/TemplateProviderInterface.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace Azine\EmailBundle\Services;
4
5
/**
6
 * Interface with methods required by the AzineEmailBundle to render the email-content in nice templates.
7
 *
8
 * @author dominik
9
 */
10
interface TemplateProviderInterface
11
{
12
    /**
13
     * Add all styles and variables that are required to render the layout of the html-email-template.
14
     *
15
     * @param string $template         the twig template for the email to render (template id in standard-notation, without the ending ( .txt.twig) => "AcmeFooBundle:bar:default")
16
     * @param array  $contentVariables array with variables required to render the content in the email
17
     *
18
     * @return array of merged template- and content-vars. Variables in the supplied array will NOT be replaced by newly added ones.
19
     */
20
    public function addTemplateVariablesFor($template, array $contentVariables);
21
22
    /**
23
     * Add template blocks that refer to images encoded in the email to the supplied array.
24
     * This function will be called AFTER the images have been embeded, so you can define vars that include embede images => e.g. see variable "cellSeparator" in class AzineTemplateProvider.
25
     *
26
     * @param string $template    the twig template for the email to render (template id in standard-notation, without the ending ( .txt.twig) => "AcmeFooBundle:bar:default")
27
     * @param array  $vars
28
     * @param string $emailLocale the locale to be used for translations for this single email
29
     * @param bool   $forWebView
30
     *
31
     * @return array of merged template-vars. Variables in the supplied array WILL BE replaced by newly added ones, if the use the same key.
32
     */
33
    public function addTemplateSnippetsWithImagesFor($template, array $vars, $emailLocale, $forWebView = false);
34
35
    /**
36
     * Just before sending the message, extra custom headers can be added to the message.
37
     *
38
     * @param string         $template
39
     * @param \Swift_Message $message
40
     * @param array          $params
41
     *
42
     * @return array of \Swift_Mime_Header
43
     */
44
    public function addCustomHeaders($template, \Swift_Message $message, array $params);
45
46
    /**
47
     * Get the absolute filesystem path to the folder where  the template-images are stored.
48
     *
49
     * @return string
50
     */
51
    public function getTemplateImageDir();
52
53
    /**
54
     * Recursively replace all absolute image paths in the $emailVars array with relative web urls.
55
     *
56
     * @see \Azine\EmailBundle\Services\AzineTemplateProvider::makeImagePathsWebRelative for a reference implementation
57
     *
58
     * @param array $emailVars
59
     * @param $locale
60
     *
61
     * @return mixed emailVars-array with relative paths for images
62
     */
63
    public function makeImagePathsWebRelative(array $emailVars, $locale);
64
65
    /**
66
     * Check if an image that should be embeded into an email is stored in an "allowed_images_folder" see config.yml.
67
     *
68
     * @param string the filesystem path to the file
0 ignored issues
show
The type Azine\EmailBundle\Services\the was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
69
     * @param string $filePath
70
     */
71
    public function isFileAllowed($filePath);
72
73
    /**
74
     * Get the filesystem-folder for the given key.
75
     *
76
     * @param $key
77
     *
78
     * @return string|bool the filesystem-folder or false
79
     */
80
    public function getFolderFrom($key);
81
82
    /**
83
     * Define for which emails you want to make the web-view available and for which not.
84
     *
85
     * @param string $template the template id in standard-notation, without the ending ( .txt.twig) => "AcmeFooBundle:bar:default"
86
     *
87
     * @return bool
88
     */
89
    public function saveWebViewFor($template);
90
91
    /**
92
     * Get the id of the webViewToken. You only have to implement this method if your TemplateProvider
93
     * doesn't extend the AzineTemplateProvider or if you wan't to change the ID from "azineEmailWebViewToken"
94
     * to something else.
95
     *
96
     * This ID is used in the AzineEmailBundle::baseEmailLayout.html.twig to show a link to the web-view.
97
     *
98
     * @return string
99
     */
100
    public function getWebViewTokenId();
101
102
    /**
103
     * Get the url-query-parameters for campaign identification.
104
     * If you work with GoogleAnalytics take a look at this page: https://support.google.com/analytics/answer/1033867.
105
     *
106
     * @param string $templateId the template id in standard-notation, without the ending ( .txt.twig) => "AcmeFooBundle:bar:default"
107
     * @param array  $params     campaing parameters already loaded
108
     *
109
     * @return array of (string => string)
110
     */
111
    public function getCampaignParamsFor($templateId, array $params = null);
112
}
113