/
ModuleConfig.cfc
61 lines (49 loc) · 1.66 KB
/
ModuleConfig.cfc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
component {
// Module Properties
this.title = "SendGrid-CFML";
this.author = "Dan Kraus";
this.webURL = "https://github.com/dankraus/sendgird-cfml/";
this.description = "CFML port of SendGrid's email library";
this.version = "1.0.0";
this.modelNamespace = "sendgrid-cfml";
this.cfmapping = "sendgrid-cfml";
this.autoMapModels = true;
function configure(){
settings = {
};
}
function onLoad(){
this.configStruct = controller.getConfigSettings();
// parse parent settings
parseParentSettings();
// Map Config
binder.map( "SendGrid@sendgrid-cfml" )
.to( "#this.cfmapping#.models.services.SendGrid" )
.initWith(
apiUsername=this.configStruct.SendGrid.apiUsername,
apiPassword=this.configStruct.SendGrid.apiPassword,
options=this.configStruct.SendGrid.options
);
}
/**
* Fired when the module is unloaded
*/
function onUnload(){
}
/**
* Prepare settings and returns true if using i18n else false.
*/
private function parseParentSettings(){
var oConfig = controller.getSetting( "ColdBoxConfig" );
var configStruct = controller.getConfigSettings();
var SendGrid = configStruct.SendGrid;
//defaults
this.configStruct.SendGrid = {
apiUsername: "dummy",
apiPassword: "pass",
options: {}
};
//Check for IOC Framework
structAppend( this.configStruct.SendGrid, SendGrid, true );
}
}