File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 114114
115115test ('A Postmark bounce request with an allowed IP address marks the contact as bounced and returns a success ' , function () {
116116 $ contact = createContact ();
117- $ _SERVER [ ' REMOTE_ADDR ' ] = ' 1.2.3.4 ' ;
118- Campaign::$ plugin ->settings ->postmarkAllowedIpAddresses = [$ _SERVER [ ' REMOTE_ADDR ' ] ];
117+ $ userIp = Craft:: $ app -> getRequest ()-> getUserIP () ;
118+ Campaign::$ plugin ->settings ->postmarkAllowedIpAddresses = [$ userIp ];
119119
120120 $ response = runActionWithParams ('webhook/postmark ' ,
121121 getPostmarkRequestParams ($ contact ->email ),
131131
132132test ('A Postmark bounce request with a disallowed IP address returns an error ' , function () {
133133 $ contact = createContact ();
134- $ _SERVER [ ' REMOTE_ADDR ' ] = '4.3.2.1 ' ;
134+ Campaign:: $ plugin -> settings -> postmarkAllowedIpAddresses = [ '4.3.2.1 ' ] ;
135135
136136 $ response = runActionWithParams ('webhook/postmark ' ,
137137 getPostmarkRequestParams ($ contact ->email ),
File renamed without changes.
You can’t perform that action at this time.
0 commit comments